-->
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: Hibernate Search : Composite Key
PostPosted: Thu Feb 25, 2010 8:09 am 
Newbie

Joined: Wed Dec 16, 2009 1:54 am
Posts: 7
Hi,
I am using composite key for a field and now while searching for list (when result count is more than one) my query is getting formed incorrectly(issue in object binding in in clause).
For example I have a class A
with composite key having Long id1; and Long id2.
I tried with both two way string and field bridge

Query is being formed is like
Code:
select ...from A where ((this_.id1, this_.id2) in ( (1, 1), (1110, 1111)))


Now both 1 are id 2 and 1110 and 1111 are id1

for single result it works fine....

my twowaystring bridge is simly
Code:
public String objectToString(Object value)
   {
      
      AId id = (AId) object;
      StringBuilder sb = new StringBuilder();
      sb.append( id.getid1())
      .append( "-" )
      .append( id.getId2());
      return sb.toString();
   }

   public Object stringToObject(String strValue)
   {
      split and then set id1 and id2 then return AId;
   }


It is working fine even for the case when Aid comes as association for some other entity.
Only in case of direct fetch for this entity I am facing issues.
Any clues?

Regards,
Suresh


Top
 Profile  
 
 Post subject: Re: Hibernate Search : Composite Key
PostPosted: Thu Feb 25, 2010 11:18 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I am not sure if I completely follow your description. Some important questions for me are.
  • What version of Search are you using?
  • Which database are you running again?
  • How do your annotated entities look like?

It could be that you are experiencing this bug - HSEARCH-306

--Hardy


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.