[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5164) HQL putting quotes around SMALLINT field
Shawn Kuenzler (JIRA)
noreply at atlassian.com
Thu Apr 29 18:32:32 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36797#action_36797 ]
Shawn Kuenzler commented on HHH-5164:
-------------------------------------
In developing a test case, I found that it was only the discriminator columns that were being quoted. Added "discriminatorType = DiscriminatorType.INTEGER" to the discriminator column annotation and the problem was fixed. Not a bug.
> HQL putting quotes around SMALLINT field
> ----------------------------------------
>
> Key: HHH-5164
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5164
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.3.1
> Environment: Hibernate 3.3.1 using org.hibernate.dialect.DB2Dialect against DB2 v9.1
> Reporter: Shawn Kuenzler
>
> HQL query generating a WHERE clause with a mapped column of java type "int" and datatype "SMALLINT" in DB2. The generated prepared statement inside of AbstractBatcher.class shows 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 2008, where the same legacy database field has a datatype of "TINYINT", SQLServer is accepting of the single quoted value in the HQL statement.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list