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
- Secure JSON Services with Play Scala and SecureSocial
- My What's New in Spring 3.1 Presentation
- Twitter's Open Source Summit: Bootstrap 2.0 Edition
- Refreshing AppFuse's UI with Twitter Bootstrap
- 2011 - A Year in Review
- Upgrading AppFuse to Spring Security 3.1 and Spring 3.1
- What have I been working on at Taleo?
- Our Engaging Trip to Paris and Antwerp
- My HTML5 with Play Scala, CoffeeScript and Jade Presentation from Devoxx 2011
- Deploying Java and Play Framework Apps to the Cloud with James Ward
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 #