Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert hibernate HQL with collection.size to criteria query

For some reason I can never figure out how to do things via criteria api.

I have a HQL:

from Track track where size(track.trackTitles) > 1

Is it possible to convert it into a criteria query on Track class? If yes, how: what Restriction should I use?

like image 519
alamar Avatar asked Jan 13 '10 16:01

alamar


1 Answers

Restrictions.sizeGt("trackTitles", 1)

like image 166
axtavt Avatar answered Sep 21 '22 22:09

axtavt