-->
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.  [ 4 posts ] 
Author Message
 Post subject: please answer Immediate
PostPosted: Mon Sep 03, 2007 10:14 am 
Newbie

Joined: Mon Sep 03, 2007 10:07 am
Posts: 3
Hi
i need help i am new to hibernate


ex:

student_id_card_details--table 1

student_details-- table 2

i want to get all student details and i want one flg for who having id card


what rel/p i can give

how i can retrive


challenge?????????

Thanks & regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 03, 2007 4:21 pm 
Beginner
Beginner

Joined: Thu May 17, 2007 2:41 pm
Posts: 48
you mean you want a one to one mapping between student and studentID?

how about you lay out the java classes for what you want first?


Top
 Profile  
 
 Post subject: LEFT JOIN
PostPosted: Tue Sep 04, 2007 2:46 pm 
Newbie

Joined: Mon Sep 03, 2007 10:07 am
Posts: 3
hi

i solved yesterday prob


pls help me how i can use left join in hibernate
my sql query
:
SELECT student.*,studentIdCard.cardId FROM student LEFT JOIN studentIdCard ON student.cardId = studentIdCard.cardId AND studentIdCard.StudentId = 1 where studentIdCard.year=2005 order by StudentName

this query gave correct result in mysql

i need implement this query in hibernate and spring


pls help me


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 04, 2007 4:28 pm 
Senior
Senior

Joined: Sat Nov 27, 2004 4:13 am
Posts: 137
well it depends on your mapping,
consider something like

select st, stid
from
student st
left outer join st.studentCard as stid
where
stid.studentId = 1 and stid.year = 2005
order by st.studentName

_________________
don't forget to credit!

Amir Pashazadeh
Payeshgaran MT
پايشگران مديريت طرح
http://www.payeshgaran.co
http://www.payeshgaran.org
http://www.payeshgaran.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.