-->
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: am hanging in join using criteria. please guide me
PostPosted: Tue May 27, 2008 9:35 am 
Newbie

Joined: Tue May 27, 2008 9:24 am
Posts: 2
using SQLQuery is working fine

but when i need to use criteria instead of using SQLQuery. am feeling difficulty

what is diff between SQlQuery join and Criteria join
which one is best

please help out.

advance thanks

waiting for reply


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 9:58 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
The biggest difference, and this is huge, is that the criteria API allows you to think of your problem domain in terms of objects, not SQL.

If you want to play around with SQL type of syntax, then HQL is probably your best bet. It combines your object model with common query language constructs. But the Criteria API lets you think of your problem in terms of objects and their relationships at a Java level, and that's a HUGE difference.

Here's a good tutorial on the Criteria API, and how it works:

http://www.thebookonhibernate.com/HiberBookWeb/learn.jsp?tutorial=09howtousethecriteriaapi

And here's a good tutorial on using Hibernate3 HQL Hibernate Query Language:

http://www.ezhibernate.com/HiberBookWeb/learn.jsp?tutorial=08masteringhqlandnamedqueries

I think you'll find the Criteria API is very easy to work with once you start thinking about your data persistence problems in terms of your objects, which is really what Hibernate is all about.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 28, 2008 9:55 am 
Newbie

Joined: Tue May 27, 2008 9:24 am
Posts: 2
thanks for the response

i will go through your links


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.