-->
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.  [ 3 posts ] 
Author Message
 Post subject: How can i write this query in Hibernate
PostPosted: Tue Aug 15, 2006 5:19 am 
Newbie

Joined: Tue Aug 01, 2006 8:31 am
Posts: 6
Hi all,

How can i write this query in Hibernate.

Please help me out it is an urgent requirement for me.


select u.user_det_id,r.reg_no,a.allotment_id,u.first_name,a.no_of_attempt,u.user_Dob,a.site_Dim_Id,a.ews_Id,a.prj_Lay_Id from User_Master u, Bda_Registration r,allotment_information a where u.user_det_id=r.user_det_id and r.reg_no=a.reg_no and a.site_Dim_Id ='04' and a.ews_Id='01' and a.prj_Lay_Id ='01' and a.category_Id ='C08' order by a.no_of_attempt,u.user_Dob desc


Regards
Sreenivasula Reddy A


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 15, 2006 8:39 am 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
You know, it's VERY difficult to write a "hibernate query" when you only post a SQL query with zero Hibernate context. Please repost, and include the following:

    The Mapping files for each of the tables you have in your SQL query, assuming you actually have those.
    Provide some more context around what your are trying to achieve.


You can't get good help, unless you ask detailed questions.

Ryan-

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember to rate!


Top
 Profile  
 
 Post subject: Re: How can i write this query in Hibernate
PostPosted: Tue Apr 17, 2007 3:34 am 
Newbie

Joined: Fri Apr 13, 2007 8:38 am
Posts: 12
u have to place hbm files and their relation ships also, below is imagination..



[img]select%20u.userDetId,r.regNo,a.allotmentId,u.firstName,a.noOfAttempt,u.userDob,a.site_Dim_Id,a.ews_Id,a.prj_Lay_Id%20from%20UserMaster%20u,%20BdaRegistration%20r,AlotmentInformation%20a%20where%20u.userDetId=r.userDetId%20and%20r.regNo=a.regNo%20and%20a.siteDimId%20='04'%20and%20a.ewsId='01'%20and%20a.prjLayId%20='01'%20and%20a.categoryId%20='C08'%20order%20by%20a.noOfAttempt,u.userDob%20desc%20[/img]

u have to create 3 hbm files and map to table,,,, and use relationships,


Regards
sricharan Reddy A[/quote]


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