-->
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: what is the best way to use joins in hibernate
PostPosted: Tue Mar 01, 2011 12:20 pm 
Newbie

Joined: Fri Feb 25, 2011 2:34 am
Posts: 11
Hi,
I am using native query (createSQLQuery) and i have 3 joins in this query, the problem is it is giving problems
Now, if i run the code as it is without addEntity... (all three tables) then the code gives an error saying the column(written in the select part of query) dont exist.
If i write the addEntity on them then it complains of non existing columns in the select statement.

I am a newbie to hibernate and struggling to meet deadline for my project, can anyone here help with my doubt, maybe point to a tutorial or so.
Pl. advice.

thanks
abhishek


Top
 Profile  
 
 Post subject: Re: what is the best way to use joins in hibernate
PostPosted: Tue Mar 01, 2011 12:31 pm 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Try to use HQL.

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject: Re: what is the best way to use joins in hibernate
PostPosted: Tue Mar 01, 2011 12:36 pm 
Newbie

Joined: Fri Feb 25, 2011 2:34 am
Posts: 11
the problem with HQL is i have to use class name and not column name in the query.
some of the column name come from the property file in my code,
Also if there is no alternative , is there a HQL editor available somewhere, the one in myeclipse (one i am using) is not good.
pl. advice

thanks
abhishek


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.