Hrorm is a concise, declarative, opinionated, type-checked library for the creation of Data Access Objects (DAOs) that will not inflict your codebase with XMLosis or annotationitis.
The hrorm website contains documentation for using it as well as detailed descriptions of the hows and whys of hrorm and its ethos.
There is not much to say here. The code builds with maven. Hrorm itself has no dependencies. The tests have a few dependencies, but they are all simply jars. The tests run against an in memory database (H2). There is not much code. Once you clone it, you're basically ready to go.
Hrorm requires Java 8.
Very short CONTRIBUTING doc.
You can also run the tests against postgres, but it takes a bit of work.
- Set up postgres locally
- User named "hrorm_user"
- Password "hrorm_password"
- "hrorm_user" must own a database named "hrorm"
- cd to the scripts directory and run the
test_postgres.shscript or edit the
HelperFactoryto use the
PostgresHelperinstead of the
Improvement Ideas and Questions
- Where object improvements:
- Is creating strange statements like "a OR b AND c" desirable? Should it be prohibited somehow?
- Can we use the column types (or field types) to improve type checking when building where clauses?
- Support for columns on joined tables?
- Support for columns on child tables?
- Hrorm does a lot of string building at query time. Should SQL strings be cached?
- Similarly, DaoBuilder objects are always mutable. Perhaps they should lock at Dao creation time?
- Support different types, e.g. String GUIDs, for primary keys
- Add methods that allow for updates and deletes based on Where objects
- Make ChildSelectStrategy for immutable models
- Check ChildSelectStrategy works for complicated structures
- Check that join-of-join child selection works for subselects with strange primary key column names