A minimal ORM for accomplishing database tasks.
- The Entity/DTO type MUST have at least one field annotated with
@PK
. This does not mean that the field needs to correlate to an actual primary key constraint in the database. - Get a new Repo via
BabyRepo.forType(Foo.class));
- Set a connection supplier (i.e. ConnectionPoolX::getConnection)
If the names of your classes and fields do not match exactly to the names of the tables and columns in the database, you will need to provide the appropriate name annotation.
If the column names only differ in casing (I.e camelCase to snake_case), you can put a @ColumnCasing
annotation on
the entity class to specify which case the database column names are in. This makes it so you don't have to put the
@ColumnName
annotation on every damn field.
If you have weird names for things: See @ColumnName
, @TableName
, @SchemaName
.
If your primary key is not auto generated by the database, you must set a KeyProvider that returns a new key.
This ORM is meant to provide super light weight ORM functionality without any dependencies. It provides full CRUD capabilities for any entity object. The plan is to add only the most commonly needed features to keep usage simple.
- Easy to learn and use
- Automagically map object fields to row columns and vice versa
- Insert, Update, Delete records
- Query by any set of columns, either ANDed or ORed together
- Query multiple values for the same key by using any kind of Collection as the value
- Arbitrary SQL query execution to fetch objects (think views in code).
- Automatically convert column names to the given Case (for instance, camelCase to snake_case)
- Support for multi column keys
- Prevent SQL injection attacks using the ORM methods. This does not apply to queries run using the execute method.
- Support storing regular object types as JSON
- Support Joins to other tables joined by multiple arbitrary keys
- Support Transactions
- Support Lazy fetching joined entities
It was an accident