-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to index the key of a map?
PostPosted: Thu Aug 20, 2009 4:43 am 
Newbie

Joined: Fri Aug 08, 2008 9:00 am
Posts: 5
Hey,

I have a map like this: Map<AttributeType, AbstractAttribute> and I'm using a Fieldbridge to index the map. Searching works fine, but after the map is recreated, all keys are of type Long (in fact the id of the value), which makes the map pretty useless. Is there a way to index the key also, so that is recreated with its original keys after the search?

Thanks in advance,
Seb


Top
 Profile  
 
 Post subject: Re: How to index the key of a map?
PostPosted: Thu Aug 20, 2009 10:56 am 
Hibernate Team
Hibernate Team

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

I am not sure whether you have a Hibernate Search problem, but rather a Hibernate mapping problem. Unless you are using projections the indexed data is only used to identify the ids of the matching entities. Once the entity ids matching the query are determined Core is used to load the results from the database.

Maybe it would help if you would post the code for your mapped entities.

--Hardy


Top
 Profile  
 
 Post subject: Re: How to index the key of a map?
PostPosted: Fri Aug 21, 2009 2:35 am 
Newbie

Joined: Fri Aug 08, 2008 9:00 am
Posts: 5
you're right, it was a mapping problem. I can set the key-value with @Mapkey.

Thanks for the hint,
Seb


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.