I'm new to Hibernate so possibly I am doing something terribly wrong or haven't read the manual correctly.
I receive the following Classcast exception:
Code:
java.lang.ClassCastException: org.wmt.pdc.KZPContractPartner
at net.sf.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:219)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:154)
at net.sf.hibernate.loader.Loader.find(Loader.java:620)
...
I use the following mapping :
Code:
<class name='org.wmt.pdc.KZPContractPartner' table='WMT_KONTRAKTPARTNER'>
<composite-id>
<key-property name='idCp' column='ID_KV'/>
<key-property name='numberClientWmt' column='NUM_CLIENT'/>
<key-property name='numberMainClient' column='NUM_MAIN_CLIENT'/>
</composite-id>
</class>
with the Java class KZPContractPartner:
Code:
private String idCp;
private String numberMainClient;
private String numberClientWmt;
with the appropriate getters and setters.
The table is defined in MySQL as
Code:
WMT_KONTRAKTPARTNER
ID_KV DECIMAL(11,0) PK
NUM_CLIENT DECIMAL(11,0) PK
NUM_MAIN_CLIENT DECIMAL(11,0) PK
Do I miss something here?
Thanks in advance.