Hibernate Enhancements
For you Hibernate users/lovers, here's some good news for you (THANKS GAVIN!):
1. [Hibernate Forum] For XDoclet users its well-worth grabbing a CVS update now, I have fixed a bunch of issues and made improvements including Hibernate2 support (thanks to Matt Raible) and joined-subclass support.
2. [Hibernate Dev List]
After a bit of research and thinking, I have settled on an approach to query by Criteria that hopefully is flexible enough for 80-90% of use cases, but still simple enough to fit in sufficiently few lines of code. The proposed new API is based loosely upon the Cayenne API. Queries may be expressed as follows: List cats = session.createCriteria(Cat.class) .add( Expression.like("name", "Izi%" ) ) .add( Expression.between("weight", minWeight, maxWeight) ) .add( Expression.eq( "mate", mate ) ) .addOrder( Order.asc("age") ) .setMaxResults(20) .list(); Which is approximately equivalent to: from Cat cat where cat.name like 'Izi%' and cat.weight between :minWeight and :maxWeight and cat.mate = :mate order by cat.age This API is marked "experimental", but I would like to stabilize it fairly soon, so early feedback is very welcome. This is all in CVS.
Posted by Carl on March 09, 2003 at 09:01 PM MST #
Posted by Matt Raible on March 09, 2003 at 10:46 PM MST #
Posted by Anonymous on March 11, 2003 at 07:45 PM MST #