Questions tagged [ebean]

Ebean is an open source Object Relational Mapping tool. It's goal is to provide a simpler alternative to JPA (Java Persistence API) implementations such as Hibernate and Eclipselink.

Ebean is an open source Object Relational Mapping tool.

It's goal is to provide a simpler alternative to JPA (Java Persistence API) implementations such as Hibernate and Eclipselink.

It does this by providing a “sessionless” API and a simpler query language. That means:

  • No Session Object (or UnitOfWork or EntityManager)
  • No Attached or Detached Beans
  • No merge(), persist(), flush(), or clear(). Instead Ebean has save() and delete()

Ebean, just like JPA has a Persistence Context but has some architectural differences to allow it to have a different approach to the entity bean lifecycle and removing the need to manage EntityManagers.

Why Ebean? ... why different from JPA?

Ebean uses the JPA Mapping annotations and will follow those very closely.

However, Ebean has been architected and built from a different perspective than JPA. The Architectural and Query language differences are reasonably fundamental to both Ebean and JPA so its hard to see these differences going away anytime soon.

JPA is architected to use an “EntityManager” which closely matches a Hibernate “Session” and a Toplink “UnitOfWork”. This brings with it the concepts that an entity bean can be attached or detached from the EntityManager (with associated merge, flush clear operations etc). If the EntityManager is used across multiple Transactions the EntityManager needs to be managed typically by a EJB Session Bean, Seam, Spring or similar container/framework.

Ebean is architected to not require an EntityManager (or Session or UnitOfWork object) with the goal of making it easier to use and to remove the requirement to manage EntityManager objects (Aka a different approach to Lifecycle management).

Although Ebean doesn't have a EntityManager it DOES have a “Persistence Context” (like JPA) and by default in Ebean the persistence context is transaction scoped and automatically managed.

1105 questions
-1
votes
1 answer

Database design for types of users

I'm planning a web system where there are mainly two types of users. My project is powered by Play! framework and ebean as the ORM layer. Now, with the OOP perspective I should create a User Model and then two more classes which extends User.…
AngryOliver
  • 357
  • 1
  • 3
  • 15
-1
votes
2 answers

Cannot create new Object from Maven dependency

I'm trying to make an Ebean ServerConfig as explained here: http://www.avaje.org/ebean/getstarted_programmatic.html But, when in my project I create a new ServerConfig object, I cannot access the methods in it. package controller; import…
Szilank
  • 1
  • 1
-1
votes
1 answer

Metasearch like library in Play Framework

When I want to offer basic searching capabilities in a web application in Rails, I install Metasearch or Ransack and am happy with it. They are simple, flexible and save me time. Now I'm developing a Java / Play Framework 2.0 application, and I…
Hans Fledermaus
  • 231
  • 3
  • 9
-1
votes
1 answer

Ebean equivalent of SQL Query

I want an Ebean equivalent of this SQL Statement SELECT A,B,C FROM TABLE1 WHERE A BETWEEN "X" AND "Y" I have the Ebean Avaje Documentation with simple queries example Any help is appreciated. Thanks in advance :)
Incpetor
  • 1,235
  • 6
  • 24
  • 46
-1
votes
1 answer

Why does Find All method selects wrong field

public class Userr extends Model{ @Id public Long id; @OneToMany List badges; } public class Badge extends Model{ @Id public Long id; @ManyToOne Userr user; } those are my 2 models and this is the error…
Belbesy
  • 107
  • 2
  • 10
-2
votes
1 answer

Unsupported conversion from DATE to java.lang.Integer

So, I have the following model generated using Java Ebean library: package models; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.ManyToOne; import javax.persistence.Table; import…
Aien Saidi
  • 479
  • 5
  • 21
-2
votes
1 answer

To extend a class which is already extends by ebean model class

I am developing a java playframework project.I am using Book class which is a sub class.It is extended from Item abstract class.I want to use com.avaje.ebean library and extend the Book class to add data to the database.So it means I have to extend…
-2
votes
1 answer

Ebean sort by different date

I´d like to get a sorted list with java bean. I got two fields in my Postgres db creation_date and update_date, I want a list sorted by whatever date is newer. creation_date default is now(), update_date can be null So if update_date is null the…
Zero Soul Eater
  • 134
  • 1
  • 11
-2
votes
1 answer

Ebean play2 delete javax.persistence.PersistenceException ... Unknown column

i already done somme delete with my model but one use wrong column name GroupeCours gc = GroupeCours.find .where() .eq("id",id) .findUnique(); GroupeCours gc2 = new GroupeCours(); gc2.id=10L; …
Lio
  • 41
  • 7
-2
votes
2 answers

what does this function do in detail?

public static Finder find = new Finder( Long.class, Task.class ); this is a function of a model in Playframework using EBean Model superclass. i dont understand this function in detail, what does it do actually?
doniyor
  • 31,751
  • 50
  • 146
  • 233
1 2 3
73
74