Sunday March 09, 2003
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 in Java
at Mar 09 2003, 09:56:16 AM MST
3 Comments
Search This Site
Recent Entries
- Wine Tasting in Napa Valley
- How to build a Shot-Ski
- Bus Project Update
- Farewell to the 2011-2012 Ski Season
- Cruising around the Western Caribbean
- Spring Break!
- A Spectacular Trip to Stockholm and Madrid
- Comparing Web Frameworks and HTML5 with Play Scala at Jfokus 2012
- Play Framework 2.0 with Peter Hilton at Jfokus
- Secure JSON Services with Play Scala and SecureSocial
Posted by Carl on March 09, 2003 at 03:01 PM MST #
Posted by Matt Raible on March 09, 2003 at 04:46 PM MST #
Posted by Anonymous on March 11, 2003 at 01:45 PM MST #