File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Object Relational Mapping
Joined: Jun 17, 2008
Oct 21, 2012 10:10:37
I want query child object while loading,
here is the query i am using :
"select app from ApplicantPerson app left join app.gpaList gpa , DesignatedSchool ds WHERE " + " app.applicantPersonId.applPersonId = ds.applPersonId AND app.appStatusCd = 'P' and gpa.verifiedInd= 1 " + " AND ds.designateStatusCd = 'A' AND ds.medInstId = ? AND app.applicantPersonId.applYear = ? " + " AND ds.applYear = ? ";
but applicantperson is having 24 records, and child gpalist has 2 records with one verified = 1 and the second is having verified =0
Note: there is one to many relation between ApplicantPerson and Gpa
But the output of the above query is 30 records and gpalist is getting 2 records.
I need out put with 24 records in parent and child gpalist with one record verified =1
I agree. Here's the link:
subject: Hibernate relations
How does Hibernate get child objects
How to insert a new child record only. One to Many Relation.
Hibernate one-to-many relationship insert
Select all row values using JPA
Hibernate eager fetching issue
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014