Criteria: class is bound to integer instead to varchar

Description

Scenario: BaseDocument.class has a field "classType" of return type class;
[code]
Criteria crit = SpringApplicationContext.getHibernateUtil().getSession().createCriteria(BaseDocument.class)
.add(Restrictions.eq(Base.CLASSTYPE, EMail.class)).setProjection(Projections.id());
/code

results in:

CRIT = CriteriaImpl(com.sobis.pirsjava.model.document.BaseDocument:this[][classType=class com.sobis.pirsjava.model.document.correspondence.EMail]id)

2014-02-28 10:38:19,778 DEBUG [main] (SqlStatementLogger.java:109) - select this_.id as y0_ from p_base_document this_ inner join jaf_base_entities this_1_ on this_.id=this_1_.id left outer join p_base_correspondence this_2_ on this_.id=this_2_.id left outer join p_doc_corr_emails this_3_ on this_.id=this_3_.id left outer join p_doc_corr_letters this_4_ on this_.id=this_4_.id left outer join p_doc_corr_comments this_5_ on this_.id=this_5_.id left outer join p_doc_corr_libraryitems this_6_ on this_.id=this_6_.id left outer join p_doc_corr_transmittals this_7_ on this_.id=this_7_.id left outer join p_base_numbered this_8_ on this_.id=this_8_.id left outer join p_doc_actionitems this_9_ on this_.id=this_9_.id left outer join p_doc_metadocuments this_10_ on this_.id=this_10_.id where this_1_.classType=?
2014-02-28 10:38:19,779 TRACE [main] (BasicBinder.java:81) - binding parameter [1] as [INTEGER] - [33]

2014-02-28 10:38:19,790 DEBUG [main] (QueueConnectorTest.java:410) - RESULTS=[]

In db, classType column is mapped as varchar(255) and contains the class name as string. So actually I expected the basic binder to perform

2014-02-28 10:38:19,779 TRACE [main] (BasicBinder.java:81) - binding parameter [1] as [VARCHAR] - [com.sobis.pirsjava.model.document.correspondence.EMail]

instead of the integer binding.

Please advise.

Environment

Hibernate 4.3.2, MySQL

Status

Assignee

Unassigned

Reporter

Niko Wittenbeck

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.3.2
5.0.5

Priority

Major
Configure