Hi!
Is it possible to add a restriction using a Criteria search on the last element of a collection? e.g. I have a Bike and it has multiple prices (Price being a composite -> Price.value, Price.category etc)and I want to restrict my search to the last element of prices.
criteria.createAlias("prices","pr").add(Restrictions.eq("pr.category", 2));
Would match any Bike that has a price category of 2 (even when the collection of prices would be [2 1 0]).
I want to replace hibSession.createQuery("from Bike bike where bike.prices[bike.prices.maxIndex].category = 0")
|