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: HQL for a Many-to-Many via Relationtable
PostPosted: Wed May 11, 2005 4:37 am 
Newbie

Joined: Mon Feb 28, 2005 12:18 pm
Posts: 3
Location: Germany
Hi folks,

I'm stuck and searched quite a long time for a problem that surely isn't that big...
I have two objects: Book and Person. Each Book may have many authors (instances of Person) and each Person may have written many Books. Many-to-Many.

The tables existing in my DB are:
- book
- books_and_authors
- person

Book and Person have a field "ID" which is represented by "FK_BOOK_ID" / "FK_AUTHOR_ID" in books_and_authors.

The Relation works with no problems, but I try to search for a Book by an Author ID.
Simple Question: How do I do that using HQL?

Thanks in advance,
Karsten


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.