-->
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: Does ContainedIn behavior require reference to parent.
PostPosted: Tue Oct 13, 2009 11:44 am 
Newbie

Joined: Tue Jul 22, 2008 11:30 am
Posts: 13
Hi,

I just wanted to verify that i need a reference to the parent in order to get the full auto indexing behavior.

For example:

I want to be able to search Items with a particular User.

I have an Indexed Entity called Item that has a User property. The User property (in Item) has the IndexedEmbedded annotation and the User entity class is marked as Embeddable.

When i add and remove users to my Item class, the index updates fine. I need the index to be updated when an User's name(or whatever) changes. Do i absolutely need to have a reference back to the Item (marked as ContainedIn) in my User Entity?
I know i can manually update the index when someone changes a User's name, but it would be awesome to have this done automatically for me. Is there another work around?

Thanks,


Top
 Profile  
 
 Post subject: Re: Does ContainedIn behavior require reference to parent.
PostPosted: Wed Oct 14, 2009 3:17 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
If you want fully functional autoindexing functionality for the Item class you need the @ContainedIn in User. Otherwise you only get index updates when the indexed entity changes not the User.

--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.