joist-java
joist-java copied to clipboard
a Java orm based on code generation
Joist is an ORM based on code generation.
The goal is to provide Rails-like "empty domain objects" in an ORM that is simple, pleasant to use, and scales nicely to really large schemas.
See joist.ws for more information.
Status
This project had been used in production for ~4-5 years, but that system is now shutdown and so Joist is maintenance mode.
I assert it is still basically a best-in-class ORM in the Java ecosystem, for it's specific codegen-/convention-driven workflow, but it could use some updating for modern Java idioms if anyone wants to pick it up.
Artifacts
The artifacts are available in Jitpack, i.e. with artifact names of com.github.stephenh.joist:joist-util:1.14.0.
Build against MySQL
The Joist test suite requires running tests against a local database; to use MySQL for this:
-
Edit
features/build.properties(which is not checked in) and set your local MySQL passwordOn a clean ~18.04 Ubuntu, see this SO answer to set your local
rootpassword. -
Run
./gradlew install
Build against Postgres
The Joist test suite requires running tests against a local database; to use Postgres for this:
-
Edit
features/build-pg.properties(which is not checked in) and set your localpostgresuser/admin passwordOn a clean Ubuntu, Postgres's admin user/password is configured by:
sudo -u postgres psql postgresand then\password postgresto set your local admin password- In
postgresql.confensurelisten_addressesis set
-
Edit
features/.../Registry.javaand change thedbfield toDb.PG -
Edit
features/.../JoistCli.javaand change thedbfield toDb.PG -
Run
./gradlew install
Note that because of Postgres's ability to defer FK constraints, the features/.../codegen output will all change as the MySQL version is currently checked-in.
Todo
- Composite columns (e.g. TimePoint with both time+zone), if needed
- Don't muck with system properties
- Repo interfaces
- Implement stub that copies values (iterates Alias,
toJdbcValue,ArrayList<Object>) - Only one commit/flush at a time, serialized transaction isolation, leverage op locks
- Implement stub that copies values (iterates Alias,
- Configuration option (global, per-collection) to disable collection ticking
- ...maybe remove/solve annoyance of cross-collection stomp?
- Document PostgreSQL/MySQL no fsync settings for faster tests