Hi. I have a simple one-to-many between Author and its Artwork(s).
I perform a search on Artworks, but sometimes I want to sort results by author name. If I add a Order.asc("author.name") to my criteria, it fails cause there is not a property called author.name on Artwork. That is true, there is a property "author" that has a property "name" but nested property are not resolved. Same problem with a Restrictions.iLike and so on.
Is a limit of criteria or there is a way to achieve this?
I also try with hibernate-search that resolve that problem very fine with @IndexedEmbedded but with those APIs I can't manage to have really exact results. To say, if I want only to search from Artwork of a certain Author and just that, I do not know how to do. So I think better way is to stay on the standard Criteria API when I need exact results and use Search API only for other kind of purpose. What do you think?
|