Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: IndexEmbedded over multiple OneToMany relationships.
PostPosted: Sun Jun 17, 2012 3:38 pm 
Newbie

Joined: Mon Feb 20, 2006 9:23 am
Posts: 7
Suppose I have classes A,B,C and A has a bidirectional OneToMany relationship to B, and B has a bidirectional OneToMany relationship to C. A is annotated with @Indexed and @Entity, and association ends are appropriately annotated with @OneToMany and @ManyToOne(... mappedBy).

I want to index the field C.name into A. So, if I've understood correctly I place an @IndexEmbedded(includePaths = { "c.name"}) on the A.getBs() method.

My question is where do I need to place a @ContainedIn annotation for indexing to operate correctly.

  • On only the C.getB() method.
  • On both the B.getA() and C.getB() methods
  • Some other answer

Many thanks.


Top
 Profile  
 
 Post subject: Re: IndexEmbedded over multiple OneToMany relationships.
PostPosted: Tue Jun 19, 2012 3:41 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
I think on both, but nothing goes over a good old unit test to make sure :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.