2011-11-18

Testing ORMLite

While various JPA implementations are the standard for good reasons, I took the time to shop around for some of the lighter ORM tools, especially one with a reasonable SQL query builder DSL.

ORMLite won this round, and I integrated it into my skeleton application, where it replaced Spring JDBC.

The @DatabaseTable and @DatabaseField annotations come with far fewer rules than JPA beans. The _ID and _NAME constants are used with the query builder.



Unfortunately Spring doesn't automagically translate the SQLException to DataAccessException, so I have to use the translator manually.



Configuring ORMLite with Spring is painless. Had to switch HSQLdb to H2, since HSQLdb threw some permission exceptions when used with ORMLite.



0 comments:

Post a Comment