MCPcopy Index your code
hub / github.com/ebean-orm/ebean

github.com/ebean-orm/ebean @v19.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v19.0.0 ↗ · + Follow
30,937 symbols 114,665 edges 3,629 files 8,967 documented · 29% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Build Maven Central : ebean License Multi-JDK Build GraalVM Native Image

Build with database platforms

H2Database Postgres MySql MariaDB Oracle SqlServer DB2 LUW Yugabyte

Build with Java Early Access versions

ebean EA datasource EA migration EA test-docker EA ebean-agent EA


Ebean ORM for Java & Kotlin

Multiple abstraction levels: Ebean provides multiple levels of query abstraction ORM Queries, mixed with SQL, DTO Queries, SqlQuery and JDBC. Work at the highest level of abstraction and drop down levels as needed.

Database migrations: Built in DB migration generation and running. Support for "rebase" migrations as well as repeatable, init and 'normal' migrations.

Awesome SQL: Ebean produces SQL that you would hand craft yourself. Use great SQL, never generate SQL cartesian product, always honor relational limit/offset.

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

Docker test containers: Docker test containers for all the supported databases. Get 100% test coverage on all the features of the database we use.

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.

Performance isn't optional: Optimise queries to only fetch what we need (partial objects). Automatically avoid N+1 via a smart load context.

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

Sponsors

Need help?

Post questions or issues to the Ebean google group or github discussions

Documentation

Goto https://ebean.io/docs/

Guides

Library reference (capabilities, scope, and AI guidance): docs/LIBRARY.md

Step-by-step guides for common tasks: docs/guides/

Available guides: - Maven POM setup - Database configuration - Test container setup - DB migration generation - Lombok with Ebean entity beans

Maven central

Maven central - g:io.ebean

Building Ebean from source

  • JDK 11 or higher installed
  • Maven installed
  • git clone git@github.com:ebean-orm/ebean.git
  • mvn clean install

Ebean 13 uses Java modules with module-info. This means that there are stricter compilation rules in place now than when building with classpath pre version 13.

For Maven Surefire testing we use <surefire.useModulePath>false</surefire.useModulePath> such that tests run using classpath and not module-path. We are doing this until all the tooling (Maven, IDE) improves in the area of testing with module-info.

Eclipse IDE

Right now we can't use Eclipse IDE to build Ebean and run its tests due to its poor support for java modules. See ebean/issues/2653

The current recommendation is to use IntelliJ IDEA as the IDE to build and hack Ebean.

IntelliJ IDEA

We want to get IntelliJ to run tests using classpath similar to Maven Surefire. To do this set: JUnit -> modify options -> Do not use module-path option

To set this option as the global default for IntelliJ use:

Run - Edit Configurations -> Edit configuration templates -> JUnit -> modify options - Do not use module-path option

end

Extension points exported contracts — how you extend this code

ExtraTypeFactory (Interface)
A factory that provides extra types to Ebean. [6 implementers]
ebean-core-type/src/main/java/io/ebean/core/type/ExtraTypeFactory.java
SpiExpression (Interface)
An expression that becomes part of a Where clause or Having clause. [12 implementers]
ebean-core/src/main/java/io/ebeaninternal/api/SpiExpression.java
PlatformHistoryDdl (Interface)
Defines the implementation for adding history support to a table. [11 implementers]
ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformHistoryDdl.java
CancelableQuery (Interface)
Defines a cancelable query. Typically holds a representation of the PreparedStatement to perform the actual cancel. [14 …
ebean-api/src/main/java/io/ebean/CancelableQuery.java
Encode (Interface)
(no doc) [8 implementers]
ebean-redis/src/main/java/io/ebean/redis/encode/Encode.java
IAddress (Interface)
(no doc) [8 implementers]
ebean-test/src/test/java/org/tests/model/interfaces/IAddress.java
TQAssocMany (Interface)
Expressions for Query Bean ToMany relationships. @param The entity bean type @param The root query bean type [2 implementers]
ebean-querybean/src/main/java/io/ebean/typequery/TQAssocMany.java
UserService (Interface)
The Interface UserService. [2 implementers]
ebean-spring-txn/src/test/java/org/example/UserService.java

Core symbols most depended-on inside this repo

get
called by 2307
ebean-api/src/main/java/io/ebean/SqlRow.java
contains
called by 2303
ebean-api/src/main/java/io/ebean/Filter.java
find
called by 1996
ebean-api/src/main/java/io/ebean/DB.java
save
called by 1124
ebean-api/src/main/java/io/ebean/DB.java
findList
called by 1103
ebean-api/src/main/java/io/ebean/SqlQuery.java
where
called by 988
ebean-api/src/main/java/io/ebean/Query.java
add
called by 897
ebean-api/src/main/java/io/ebean/InTuples.java
append
called by 692
ebean-core/src/main/java/io/ebeaninternal/server/deploy/DbSqlContext.java

Shape

Method 26,954
Class 3,545
Interface 344
Enum 94

Languages

Java100%
Kotlin1%

Modules by API surface

ebean-api/src/main/java/io/ebean/DatabaseBuilder.java425 symbols
ebean-api/src/main/java/io/ebean/config/DatabaseConfig.java307 symbols
ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptor.java284 symbols
ebean-core/src/main/java/io/ebeaninternal/server/querydefn/DefaultOrmQuery.java233 symbols
ebean-core/src/main/java/io/ebeaninternal/server/expression/DefaultExpressionList.java167 symbols
ebean-core/src/main/java/io/ebeaninternal/server/core/DefaultServer.java163 symbols
ebean-core/src/main/java/io/ebeaninternal/server/expression/JunctionExpression.java156 symbols
ebean-api/src/main/java/io/ebean/ExpressionList.java144 symbols
ebean-core/src/main/java/io/ebeaninternal/api/SpiQuery.java143 symbols
ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanProperty.java142 symbols
ebean-test/src/test/java/io/ebean/xtest/internal/api/TDSpiEbeanServer.java127 symbols
ebean-core/src/main/java/io/ebeaninternal/server/deploy/meta/DeployBeanProperty.java127 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Datastores touched

(mysql)Database · 1 repos
test_ebeanDatabase · 1 repos
otherDatabase · 1 repos
readonly_testDatabase · 1 repos
unitDatabase · 1 repos

For agents

$ claude mcp add ebean \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page