Ebean ORM for Java/Kotlin
Fast and simple data access on the JVM
Current version -
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();
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
Getting started