File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate: how to look for objects in a Set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate: how to look for objects in a Set" Watch "Hibernate: how to look for objects in a Set" New topic
Author

Hibernate: how to look for objects in a Set

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
I am trying to figure out what is the best way to write the HQL statement for the following scenario:

I have a class Book which has a property of the type Set<Author>. The class Author has properties such as name, etc.

Now my DAO method gets "Set<Author> authors" as a parameter. For this method I want to write an HQL query so I could get all the Books that at least one of their Authors is found in authors.

What is the best way to accomplish this?

Thanks!

We must know, we will know. -- David Hilbert
 
Don't get me started about those stupid light bulbs.
 
subject: Hibernate: how to look for objects in a Set
 
Similar Threads
JSTL and collections
Inserting data in Intermediate table on the Many-to-Many
So much on the Left Joins in Hibernate
Passing Set<java.lang.Object> and List<java.lang.Object> in Axis 2.0
Spring pre-select/pre-populate MULTI-SELECT box OPTIONs