-->
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.  [ 1 post ] 
Author Message
 Post subject: HQL and dialects
PostPosted: Fri Jun 11, 2004 2:24 pm 
Newbie

Joined: Fri Jun 11, 2004 2:20 pm
Posts: 1
HQL and dialects

Hi. I've been trying to write this query in HQL:

Code:
select t.name,count(phones)
from employee t
left outer join t.phone_numbers phones on
(phones.employee.id=employee.id and employee.name like 'C%')


i.e, extract all the employees and their number of phones, wheter they have phones or not, with a given condition.

But HQL does not support the keyword "on", I think, although Postgresql (my RDBMS of choice) does. If I write a condition in the "where" clause, then I don't get all the employees.

But then I came to the HQL chapter on the documentation, and this line caught my attention:

Quote:
"The next query uses the MS SQL Server isNull() function to return all the accounts and unpaid..."


Apparently it's invoking a native SQL function from HQL. Can I take benefit from the underlying RDBMS in my HQL code? The only thing I've found about dialects on the docs is this, which hasn't resolved my doubts:

http://www.hibernate.org/hib_docs/refer ... l-dialects

I would very much appreciate help on this, since now I'm writing some horrid code that I would love to avoid.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.