Ebean ORM

Persistence for Java & Kotlin

 

Getting started

Documentation

Github

Simple

Easy to use persistence with save() and delete(), bulk updates, direct use of SQL when needed.
Built by developers for developers

Performant

Fast queries, batch persisting, bulk updates and deletes, great SQL. N+1 handling out of the box, L2 caching.
Enjoy the simplicity at full speed

Flexible

Use SQL directly, Soft deletes, Auditing, JSON, Multi-tenant, History, Encryption, Array types ...
Can handle the hard stuff

Search documentation:

Testimonials:

After struggling with what I'd call surprising behavior of a JPA implementation, I discovered Ebean. Time and time again I found that Ebean simply works the way I expect it to. Love it!

Daryl Stultz
OpenTempo, Inc.

About Ebean

JPA Mapping

Ebean uses JPA mapping annotations.

@Entity
@Table(name="customer")
public class Customer extends BaseModel {

  @Column(length=100)
  String name;

  @ManyToOne(cascade=CascadeType.ALL)
  Address billingAddress;

  @OneToMany(mappedBy="customer")
  List<Contact> contacts;
  ...

Simple to use

Ebean provides a simple programming model that developers can understand and master quickly.

// insert ...
Customer customer = new Customer("Joe");
customer.save();

...

// find and update ...
Customer customer = Customer.find.byId(42);
customer.setName("Montana");
customer.save();

Type safe queries

We can use Query beans to build queries in a type safe manner.

List<Customer> customers =

  new QCustomer()
    .name.istartsWith("rob")
    .billingAddress.city.equalTo("Auckland")
    .setMaxRows(10)
    .orderBy()
      .name.asc()
    .findList();

more details on queries