ebean

Ebean - Wikipedia, the free encyclopedia

Ebean

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Ebean
Developer(s)Avaje
Stable release2.7.5 / March 14, 2012; 7 days ago (2012-03-14)
Development statusActive
Written inJava
Operating systemCross-platform
PlatformJava
Size6.1 MB (archived)
TypeObject-relational mapping
LicenseLGPL license
Websitehttp://www.avaje.org/

Ebean is an object-relational mapping product written in Java. It is designed to be simpler to use and understand than JPA (Java Persistence API) or JDO (Java Data Objects) products.

Contents

 [hide

[edit] 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 EntityManager's. This adds up to make Ebean's API much easier to learn understand and use.

[edit] 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 IBatis into a single persistence framework.

[edit] 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.

[edit] Examples

// find customer by id
Customer customer = Ebean.find(Customer.class, 1);
 
// more complex query with joins
List<Order> order =
   Ebean.find(Order.class)
    .join("customer")
    .join("customer.billingAddress")
    .join("customer.shippingAddress")
    .join("details")
    .join("details.product", "name")
    .where().eq("shipDate", today)
    .findList();
posted on 2012-03-26 09:32  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2012/03/26/2417389.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值