[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4050) yes_no type is broken

David J. M. Karlsen (JIRA) noreply at atlassian.com
Tue Jul 21 09:49:17 EDT 2009


yes_no type is broken
---------------------

                 Key: HHH-4050
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4050
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.7
         Environment: Windows XP
DB2 9.5
Hibernate 3.2.7
            Reporter: David J. M. Karlsen


The yes_no usertype seems broken.
Stacktrace:
Caused by: java.lang.ClassCastException: java.lang.String incompatible with java.lang.Boolean
	at org.hibernate.type.CharBooleanType.toCharacter(CharBooleanType.java:44)
	at org.hibernate.type.CharBooleanType.set(CharBooleanType.java:35)
	at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)
	at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:116)
	at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:44)
	at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:491)
	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1567)
	at org.hibernate.loader.Loader.doQuery(Loader.java:673)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
	at org.hibernate.loader.Loader.doList(Loader.java:2217)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2108)
	at org.hibernate.loader.Loader.list(Loader.java:2103)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:340)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1122)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
	at org.springframework.orm.hibernate3.HibernateTemplate$31.doInHibernate(HibernateTemplate.java:956)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
	at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedParam(HibernateTemplate.java:947)
	
	There is a cast to Boolean, but the actual argument is the string.
	
	Mapping configuration:
	<property name="myProperty" type="org.hibernate.type.YesNoType" length="1" column="SDDBA_DEBTOR_ALL_ACCOUNTS_IND" not-null="true" />
	
	The column is declared as char(1) not null


-- 
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