-->
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: How to page results from a Set-based association?
PostPosted: Mon Mar 31, 2008 9:28 am 
Newbie

Joined: Fri Mar 21, 2008 11:21 am
Posts: 3
Location: Germany
Name and version of the database you are using:
PostgreSQL 8.2

Hi,

I've got something like this:
Image

I have configured the mapping-files and the java-classes so that a unidirectional Set-based association works, i.e. can get a "Form" this way:
Code:
User user = (User) session.load(User.class, UserId);
Set result = user.getForm();


What I would like to do is browsing the result, by using the database instead of doing it manually.

Basically I need something like this:
Code:
Select * from Form
  join User_Form on User_Form.Form_ID=Form.Form_ID
  join User on User.User_ID=User_Form.User_ID
  where User.User_ID=?
  LIMIT ? OFFSET ?


I know how to do it when using createCriteria or createQuery with setMaxResults and setFirstResult. But how does it work on a Set-based association? Is it even possible?


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.