-->
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: Index fields in collections associated without @JoinTable
PostPosted: Wed Jul 16, 2014 4:38 pm 
Newbie

Joined: Wed Jul 16, 2014 4:11 pm
Posts: 1
Hello for everyone!

I have the following (simplified) structure of classes:

Code:
public class Book{

String title;

@OneToMany
List<BookAuthor> bookAuthors
...
}

public class BookAuthor{

@ManyToOne
Book book;

@ManyToOne
Author author;

(Some additional fields)
}

public class Author{

String name;

@OneToMany
List<BookAuthor> bookAuthors;
}



My problem is how to annotation the classes and properties, to search a Book by its author names, something like "book.bookAuthors.autor.name:somename".

I have some extra fields in the association class (BookAuthors), so I can't use the @JoinTable annotation, instead, I have to instantiate the association class manually, in order to set these fields. Other similar queries (but in associations using @JoinTable) works normally, just putting the @IndexedEmbedded/@ContainedIn annotations on both sides.

How can I solve this?

I found some topics about the "includePaths" property of @IndexedEmbedded annotation, but this property does not exists in my version (3.1.1GA).

Thanks for any help!


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.