Ebean ORM

Persistence for Java & Kotlin


Databases supported

H2, Postgres, MySql, NuoDB, PostGIS, MariaDB, SQL Server, Oracle, Hana, CockroachDB, Clickhouse, Sqlite.

Multiple abstraction levels

Ebean provides multiple levels of query abstraction.

Work at the highest level of abstraction and drop down levels as needed.

Benefits of ORM

  • Automatically avoid N+1
  • L2 caching to reduce database load
  • Queries mixing database and L2 cache
  • Automatically tune ORM queries
  • Elasticsearch for search or L3 cache.

Docker test containers

Docker test containers for all the supported databases.

Get 100% test coverage on all the features of the database we use.

Database migrations

Built in DB migration generation and running.

Support for "rebase" migrations as well as repeatable, init and 'normal' migrations.

Type safe queries

We can build queries using type safe query beans.

IDE auto-complete when writing queries, compile time checking and it's FUN.

Automated query tuning

For ORM queries Ebean can profile the object graph being used and either automatically tune the query.

Awesome SQL

Ebean produces SQL that you would hand craft yourself.

Use great SQL, never generate SQL cartesian product, always honor relational limit/offset.

Performance isn't optional

Optimise queries to only fetch what we need (partial objects).

Automatically avoid N+1 via a smart load context.

silver sponsors

Maximilian Holtzberg
Szabolcs Hubai

Search documentation



About Ebean

JPA Mapping

Ebean uses JPA mapping annotations.

public class Customer extends BaseModel {

  String name;

  Address billingAddress;

  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");


// find and update ...
Customer customer = Customer.find.byId(42);

Type safe queries

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

List<Customer> customers =

  new QCustomer()

more details on queries


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.