-->
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: best way to do user scoped finds
PostPosted: Sun Dec 21, 2008 3:00 pm 
Newbie

Joined: Sun Dec 21, 2008 2:56 pm
Posts: 1
Hey, what is the preferred way to do this in hibernate.

Lets say you have a user that has many books

For example in activerecord/rails you would do:

To get user: joels book with id:123

joel.books.find(123)
(this scopes the where clause where joels id is in the find)
select * from books here id = 123 and user_id = 123

So what is the preferred way to do this in hibernate?

thanks
Joel


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.