Question

I need a super light weight persistence layer for a java app I'm writing. I need it to be a stand alone app and so far I've played with Ammentos & Persistence4J. I like them both (especially Ammentos) but I cannot find much on it on the web and I'm looking for some thoughts on these two or any other persistence layers that you think would be easy to deploy with a mysql db.

I've only used hibernate in the past so I'm looking for an alternative that just allows me to do simple saves and retrievals. Support for any complex queries is not needed.

Was it helpful?

Solution

Don't forget OrmLite.

Make sure you need an ORM at all, though.

Edit to respond to comment

For simple Java projects (a rarity these days) I often don't bother with ORM, but still use Commons BeanUtils' RowSetDynaClass sometimes. This wraps query results and allows copying to domain objects using normal BeanUtils copyProperties-type methods.

OTHER TIPS

All of these tools are very lightweight wrappers for JDBC, without adding any ORM / ActiveRecord features:

These tools add a couple of additional features related to ORM / ActiveRecord models and are thus a bit less lightweight:

These ones also feature a fluent API for typesafe SQL construction:

Spring's SimpleJdbcTemplate is as lightweight as it gets. You can use SQL without all the boilerplate. You don't need the full Spring machinery, either - just use what you need.

If SimpleJdbcTemplate is too light for you, try iBatis. It's an intermediate step between JDBC and Hibernate.

I designed sormula specifically to be a lightweight ORM. It is CRUD-ready and POJO-friendly. You don't write any DAO's. Zero-configuration, zero-annotation is possible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top