Ebean
   HOME

TheInfoList



OR:

Ebean is an
object–relational mapping Object–relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is a programming technique for converting data between type systems using object-oriented programming languages. This creates, in effect, a "virtual object databa ...
product written in
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
. It is designed to be simpler to use and understand than JPA (Java Persistence API) or JDO (Java Data Objects) products.


Simple API

Ebean has a simpler API than JPA. It achieves this through its 'Session Less' architecture. Ebean does not require a JPA EntityManager or JDO PersistenceManager and this removes the concepts of detached/attached beans and the issues associated with flushing/clearing and 'session management' of EntityManagers. This adds up to make Ebean's API much easier to learn, understand and use.


Relational features

Although Ebean has full ORM features (equivalent to JPA) it also has incorporated 'SQL/Relational' features. The idea being that many development efforts require control over the exact sql, calling stored procedures or are more simply solved with 'Relational' approaches. The ultimate goal for Ebean is to combine the best ORM features from JPA with the best 'Relational' features from products like MyBatis into a single persistence framework.


Object–relational mapping

Ebean uses the same mapping as JPA with its @Entity, @Table, @OneToMany etc. annotations and xml. The mapping of Entity beans should be compatible between Ebean and JPA. Going beyond JPA Ebean supports Java Generics and fetching "Partial" objects with its Query object.


Examples

// find customer by id Customer customer = Ebean.find(Customer.class, 1); //Saving the changes of the customer object customer.save(); // more complex query with joins List order = Ebean.find(Order.class) .fetch("customer") .fetch("customer.billingAddress") .fetch("customer.shippingAddress") .fetch("details") .fetch("details.product", "name") .where().eq("shipDate", today) .findList();


See also

*
List of object–relational mapping software This is a list of well-known object–relational mapping software. It is not up-to-date or all-inclusive. Java *Apache Cayenne, open-source for Java *Apache OpenJPA, open-source for Java * DataNucleus, open-source JDO and JPA implementation (forme ...


References


External links

*
GitHub page
{{Java (Sun) Object-relational mapping Java enterprise platform