-->
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.  [ 2 posts ] 
Author Message
 Post subject: how to make a filtered join?
PostPosted: Tue May 02, 2006 4:58 am 
Newbie

Joined: Fri Apr 28, 2006 3:07 am
Posts: 2
Hello,

I need a join, for instance, book shelf joined with new books.
There is a table of book shelfes and a table of books, book has a property named "new".

How do I implements shelf.getNewBooks() ?

Of course, I know that i can write a query to get new books, but the method getNewBooks() would require a session as a method artument and i don't like that..

Is there any smart way?
Thank you.


Top
 Profile  
 
 Post subject: Re: how to make a filtered join?
PostPosted: Tue May 02, 2006 10:05 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
posu wrote:
Hello,

I need a join, for instance, book shelf joined with new books.
There is a table of book shelfes and a table of books, book has a property named "new".

How do I implements shelf.getNewBooks() ?

Of course, I know that i can write a query to get new books, but the method getNewBooks() would require a session as a method artument and i don't like that..

Is there any smart way?
Thank you.


you can specify a named query in your bookshelf class definition.
then the hibernate proxy will do everything for you. you won't need to pass a session.

_________________
Please don't forget to give credit, if my posting helped to solve your problem.


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

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.