I would like to know how I should change the criteria at the page 264 to retrieve all the Items that do not have any Bids or have bids under 100$?
The mapping between item and bid is one-to-many and the criteria given in p. 264 is
List results = session.createCriteria(Item.class)
.add( Expression.like("description", "gc", MatchMode.ANYWHERE) )
.createCriteria("bids")
.add( Expression.gt("amount", new BigDecimal("100") ) )
.list();
I am specially interested how to test if parent in one2many relation does not have any children.
|