-->
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: Escaping colons using createSQLQuery in Hibernate 3 (again)
PostPosted: Tue Jun 28, 2005 6:45 pm 
Newbie

Joined: Wed Jun 01, 2005 7:51 pm
Posts: 13
This topic was posted previously on 11-Feb-2005.
Allegedly, this was fixed; see:

http://opensource.atlassian.com/project ... se/HB-1042

However, neither \: nor :: work in a SQL query such as:
Code:
String sql = "select cat.originalId as {cat.id}, " +
    "cat.mateid as {cat.mate}, cat.sex as {cat.sex}, " +
    "cat.weight*10 as {cat.weight}, cat.name as {cat.name} " +
    "'2005-6-28 13:54:12' AS {cat.date}" +
    "from cat_log cat where {cat.mate} = :catId"

Perhaps, Gavin King, who wrote in the link referenced above:
Quote:
This is fixed by new query parser in HB3. We wont fix in the old parser, since it is being end-of-lifed. Workaround is to use a parameter instead of a literal.

would enlighten us on how to do this.

Thanks,
Brian Cox
Hibernate version:
3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

[/quote]


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.