Hacker News new | ask | show | jobs
by lyind 1825 days ago
I have reached the same conclusion regarding ORMs after strugling with Hibernate/JPA for some time.

At least for Java and Kotlin the awesome library jdbi ( https://jdbi.org/ ) implements a very useful hybrid approach.

One creates DAOs and Repositories to abstract away the DB and map results and arguments to/from objects on the fly. All while retaining full control over the SQL and all mapping aspects.

This way SQL and mapping can be optimized to leverage the features of each database (ie. PostgreSQL's array, UUID, hash and JSON types) or be handled generically.

The SQL loading can also be customized to read SQL from pure ".sql" files in resources/files or from inline specification via annotations.

The jdbi developers have in the past reacted very fast and competent to issue reports or PRs.

If find applications built using this library more easy to understand and also better performing than ones using a full-blown ORM.

1 comments

JDBI is amazing.