-->
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: Make a query
PostPosted: Tue May 14, 2013 10:39 am 
Newbie

Joined: Sun May 12, 2013 2:08 pm
Posts: 5
Hello,

If I use this kind of configuration on my hibernate.cfg.xml:

Code:
<!-- SQL dialect -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>


Can I do querys in HQL language or only in SQL?

Cheers!


Top
 Profile  
 
 Post subject: Re: Make a query
PostPosted: Thu May 16, 2013 7:55 am 
Newbie

Joined: Sun Oct 02, 2005 12:49 am
Posts: 15
The hibernate.dialect indicates to hibernate the database for which it needs to generate SQL given the HQL or Criteria Objects that you construct in your code. It does not define what you use in your program. Ideally, you should always be using HQL or the criteria API. Although for very exceptional scenarios where hibernate does not support a database specific SQL function or feature, you can use the Session.createSQLQuery() method that the Session Interface exposes.


Top
 Profile  
 
 Post subject: Re: Make a query
PostPosted: Thu May 16, 2013 8:05 am 
Newbie

Joined: Sun May 12, 2013 2:08 pm
Posts: 5
Hello ranjan_george!

Ok I'ts works.

Thanks!


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.