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 putting quotes around SMALLINT field - db2 unhappy
PostPosted: Fri Apr 23, 2010 5:49 pm 
Beginner
Beginner

Joined: Tue Mar 17, 2009 12:19 pm
Posts: 22
Hibernate 3.3.1 using org.hibernate.dialect.DB2Dialect

I have a HQL query generating a WHERE clause with a mapped column of java type "int" and datatype "SMALLINT" in DB2. Looking at the prepared statement inside of Hibernate's AbstractBatcher.class I see that it has placed single quotes around the value (i.e. '11'). DB2 complains with a "SQL0401N The data types of the operands for the operation "=" are not compatible." error. Running the query in the DB2 Command Center I see it just needs the quotes removed.

I see that in SQLServer, where the same legacy database field has a datatype of "TINYINT", SQLServer is accepting of the single quoted value in the HQL statement.

Is there something I can do to remove the single quoting of the value? Shouldn't the dialect handle this?

Thanks


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.