-->
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.  [ 6 posts ] 
Author Message
 Post subject: difference between hql and ejbql
PostPosted: Wed Feb 02, 2005 3:22 am 
Newbie

Joined: Wed Feb 02, 2005 3:16 am
Posts: 2
hi,
could any one pls give the difference between the hql and ejbql in a point wise difference and which among them is better and why ? hope this question is related to this topic

hope that some one can help ans my query

thanks in advance
balabeera


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 02, 2005 2:20 pm 
Beginner
Beginner

Joined: Mon Jan 03, 2005 12:49 pm
Posts: 21
They look very alike. If you know ejbql, you shouldn't have problems learning HQL. In my opinion, HQL is far more elegant and powerful than EJBQL.

A word of caution: you souldn't use HQL all the time... just when things get too hard to do it with other methods. First, you should rely in your domain logic connectors. Then, on the Criteria Object. Only after this, you should use HQL.

Bye


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 02, 2005 6:25 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
-> means has influenced

EJBQL -> HQL -> EJB3QL

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 03, 2005 3:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I think you priority list are wrong or at least not precise.

One should use what best fits the job - and the "level of hardness" in a problem doesnt define which query mechanism to use.

Domain level connectors are like navigating a graph and it quickly get to damn slow if you spread out your navigation...(because you are hitting the database multiple times).

Explicitly defining what you want to fetch via HQL *or* Criteria is often the most efficient way to do things....and wether you like HQL before Criteria or the other way around is totally up to the developers style and needed functionallity.

(I prefer HQL over Criteria in H2, but with the new projection API and result transformers in Hibernate 3 i'm starting to use Criteria more - but i still most often use HQL)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: be specific
PostPosted: Thu Feb 03, 2005 5:15 am 
Newbie

Joined: Wed Feb 02, 2005 3:16 am
Posts: 2
could u people be specific and tell me what exactly the difference between the hql and ejbql and pls give me a point wise difference between the two


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 03, 2005 9:09 am 
Beginner
Beginner

Joined: Mon Jan 03, 2005 12:49 pm
Posts: 21
balabeera:
I think you should see de documentation about HSQL... you'll notice the differences faster than by any other method.

As for the navigation, criteria and HQL, I did not expressed quite clear my thoughs. You're right in that the only involved factor is not the difficulty of the operation. But if you use HQL all the time, you gradually start to lose the advantages that a good graph gives you. Although HQL is great, it still is a SQL-like language. And you always can go back at later time and tweak some precise place where the performance is not all that you want and put some HQL instead of a graph connection. But, most of the time, graph navigation will be fine and it implies no extra programming effort.

Bye !!


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