-->
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: Query Substitutions for SQL keywords
PostPosted: Mon Apr 25, 2005 4:59 pm 
Newbie

Joined: Tue Sep 09, 2003 12:49 pm
Posts: 8
Hibernate 3.0.1

I'm in the process of converting from 2.1 to 3.0.1, and ran into a problem with query substituions.

I have some queries where results are ordered such that null values should be last. Since several of the databases I'm using (Postgress, SqlServer) use different semantics for sorting nulls, I use a query substitution (null_last) rather than asc or desc in the query. This is changed in the different property files for Postgres and SQL Server. This worked fine in 2.1

It doesn't work in 3.0.1 though, because the HQL grammer is parsed prior to any substitutions, and my substitution violates the grammar defined for HQL. Shouldn't substitions be process first?

Are there any work arounds or alternative solutions to this?

Thanks,
Jon


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 24, 2005 11:26 am 
Beginner
Beginner

Joined: Mon Mar 07, 2005 6:23 pm
Posts: 21
I've run into this problem also. Has anyone figured out a way to implement NULLS LAST ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 11:23 am 
Newbie

Joined: Tue Sep 09, 2003 12:49 pm
Posts: 8
I never came up with a good workaround. I basically change my build process to make the substitution, rather than have hibernate do it.

I thought about submitting a patch to hibernate, but ended up doing it the quick and easy way.

Jon


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.