Light weight alternative to Hibernate? [closed]

Solution 1:

Hibernate requires next to zero configuration if you use annotations. It even can auto-discover mapped beans in the classpath! I don't see any alternative to it from both simplicity and power point of view.

It can also expose itself as JPA, which is (IMHO) even simpler.

Solution 2:

My ORMLite library is one such alternative. It supports MySQL, Postgres, Microsoft SQL Server, H2, Derby, HSQLDB, and Sqlite, and can be easily extended to others. It uses annotations to configure classes, good Spring support, flexible query builder, etc..

Solution 3:

It still requires XML configuration, but have a look at MyBatis (formerly iBatis).

Solution 4:

jOOQ ships with a fluent DSL simulating SQL directly in Java as a side-effect for its main goals which are:

  • Source code generation
  • Full support for standard SQL including SQL language features such as UNIONs, nested SELECTs, all types of JOINs, aliasing (e.g. for self-joins), etc
  • Wide support for non-standard SQL including UDT's, stored procedures, vendor-specific functions, etc.

Read about jOOQ in this article: http://java.dzone.com/announcements/simple-and-intuitive-approach, or visit the website directly: http://www.jooq.org

(Disclaimer, I work for the company behind jOOQ)