-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate search with many to many relation
PostPosted: Wed May 22, 2013 10:52 am 
Newbie

Joined: Sun May 19, 2013 2:44 pm
Posts: 10
I'm new to Hibernate Search. I've a manyToMany relation and want to perform search. They are defined in 3 tables - Person, Role, PersonRoles. Where do I use the @IndexedEmbedded and @ContainedIn annotations if I want to search by role and get a list of persons?

Person
@OneToMany(mappedBy="person",fetch=FetchType.LAZY)
private Set roles;Role
@OneToMany(mappedBy="role",fetch=FetchType.LAZY)
private Set persons;PersonRole
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="PERSON_ID")
private Person person;

@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="ROLE_ID")
private Role role;


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

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.