Well I’m working on a new project and I thought I would test out the Jakarta project Torque for persistence layer. The setup was pretty easy although it took me a little longer to figure out how to configure it with Resin and db pooling.
You use XML to define your objects like so:
< table name="author" description="Author Table">
Once you setup your schema the coding is easy peasy:
Book book = new Book();
Criteria crit = new Criteria();
crit.add(BookPeer.title, “Thinking in Java”);
List list = BookPeer.doSelect(crit);
There are ant tasks defined for creating the database, generating the tables, pre-populating tables, and generating your source code. It has transactional support, object and method caching, and a variety of methods of db pooling built in. It also can perform cascading deletes.
Another cool thing is that you can create criteria to use SQL joins to get an object and its foreign key objects thereby elimating multiple selects for an object.
Pretty cool. I’m anxious to see how it performs under a load.