Hi,
I have a table that consists only of one column of type string.
The primary key is also that column:
The table is called DURATION_TYPE, and the column is called "TYPE".
Code:
<hibernate-mapping>
<class name="nl.digirap.model.registration.DurationType" table="DURATION_TYPE" lazy="false">
<id name="type" type="string" column="TYPE"/>
</class>
</hibernate-mapping>
I get this error:
Code:
[#|2008-08-07T21:39:08.273+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=9c7eab0d-1f3e-4b16-be39-967fa1f7dd50;|StandardWrapperValve[DigiRap]: PWC1406: Servlet.service() for servlet DigiRap threw exception
org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class java.lang.String
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86)
What am I missing here?
Does an id need to be integer?
Code:
public DurationType findDurationType(String type) {
return (DurationType) getHibernateTemplate().get(Cyclus.class,
type);
}