-->
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: Hibernate fetch parent & child but with child restrictions
PostPosted: Wed Mar 09, 2016 9:06 am 
Newbie

Joined: Wed Mar 09, 2016 9:00 am
Posts: 2
Hi,

I have a situation where we do server side pagination to load UI grid data. Data is present in staging tables in DB.

Header (parent)
->Lines (child) one to many
-> Udf (child) one to many

I need to fetch one parent (header) object whose child (lines) might have n number of objects but i should only fetch first 25 objects based on the serial number of Lines object. along with that i should also fetch the respective Udf objects for all the 25 lines also.

Please advice me the best approach to achieve this.


Top
 Profile  
 
 Post subject: Re: Hibernate fetch parent & child but with child restrictions
PostPosted: Wed Mar 09, 2016 9:23 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
You can use a DTO for the UI. The DTO could have the parent entity. Then you select max N Lines with a separate query that joins with UDF too.


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.