-->
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.  [ 2 posts ] 
Author Message
 Post subject: Query for objects using in-attribute comparision
PostPosted: Tue Nov 05, 2013 6:38 am 
Newbie

Joined: Tue Nov 05, 2013 6:28 am
Posts: 1
Hi,

How can objects be queried by only making comparisions among its attributes without using an arbitrary value?
For example, for an object type 'X' with attributes 'a', 'b', 'c', 'd', how can we query for all 'X' type objects whichever satisfy the conditions like X.a == X.b, X.c > X.d, X.d < X.a, etc. but not like X.a == 10,...

Thanks.


Top
 Profile  
 
 Post subject: Re: Query for objects using in-attribute comparision
PostPosted: Mon Nov 11, 2013 6:38 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
That's probably better done using a relational query, using HQL (and not using Hibernate Search).

If you need to use Hibernate Search for this - for example because you need to combine this condition with other full-text criterias - then you can do it but you'll need to write a custom Collector implementation.

http://lucene.apache.org/core/3_6_2/api/core/org/apache/lucene/search/Collector.html

_________________
Sanne
http://in.relation.to/


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

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.