-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Criteria query on embedded property
PostPosted: Tue Feb 09, 2010 6:55 am 
Newbie

Joined: Tue Oct 06, 2009 1:40 pm
Posts: 10
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.