hi,
I get the following exception with hibernate 2.0:
ClassCastException
exception setting property value with CGLIB
setter of com.cpusoftwarelab.c6.app.vo.LebenshaltungskostentabelleVO.?
I tried to isolate the problem and reduced my code but the exception
remains. Can someone help me ?
I use a CompositeUserType com.cpusoftwarelab.c6.app.vo.C6Betrag and
this works in some other classes (see AuszahlungVO), but in
my class com.cpusoftwarelab.c6.app.vo.LebenshaltungskostentabelleVO
I can create an persistent entry in the database but get
the mentioned exception every time I load the saved entry
with his key.
This is our mapping from class LebenshaltungskostentabelleVO and
from LebenshaltungskostenVO, which contains a list from LebenshaltungskostentabelleVO.
<hibernate-mapping>
<class
name="com.cpusoftwarelab.c6.app.vo.LebenshaltungskostentabelleVO"
table="LHKTABELLE"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="VOID"
type="string"
length="32"
unsaved-value="null"
>
<generator class="uuid.hex">
</generator>
</id>
<timestamp
name="aenderungszeitpunkt"
column="TIME_MODIFIED"
/>
<property
name="betrag"
type="com.cpusoftwarelab.c6.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="BTR"
/>
<column
name="BTRWHG"
length="3"
/>
</property>
<property
name="erstellungszeitpunkt"
type="timestamp"
update="true"
insert="true"
column="TIME_CREATED"
/>
<property
name="geaendertVon"
type="java.lang.String"
update="true"
insert="true"
column="MODIFIED_BY"
/>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class
name="com.cpusoftwarelab.c6.app.vo.LebenshaltungskostenVO"
table="LEBENSHALTUNGSKOSTEN"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="VOID"
type="string"
length="32"
unsaved-value="null"
>
<generator class="uuid.hex">
</generator>
</id>
<timestamp
name="aenderungszeitpunkt"
column="TIME_MODIFIED"
/>
<list
name="tabelle"
lazy="false"
inverse="false"
cascade="all"
>
<key
column="LHK_ID"
/>
<index
column="LHKTAB_ID"
type="integer"
/>
<one-to-many
class="com.cpusoftwarelab.c6.app.vo.LebenshaltungskostentabelleVO"
/>
</list>
</class>
</hibernate-mapping>
this is the create SQL for the table:
create table LHKTABELLE (
VOID VARCHAR2(32) not null,
TIME_MODIFIED DATE not null,
BTR DOUBLE PRECISION,
BTRWHG VARCHAR2(3),
TIME_CREATED DATE,
MODIFIED_BY VARCHAR2(255),
LHK_ID VARCHAR2(32),
LHKTAB_ID NUMBER(10,0),
primary key (VOID)
);
this is the mapping form the working example AuszahlungVO:
<hibernate-mapping>
<class
name="com.cpusoftwarelab.c6.app.vo.AuszahlungVO"
table="AUSZAHLUNG"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="VOID"
type="string"
length="32"
unsaved-value="null"
>
<generator class="uuid.hex">
</generator>
</id>
<timestamp
name="aenderungszeitpunkt"
column="TIME_MODIFIED"
/>
<property
name="betrag"
type="com.cpusoftwarelab.c6.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="BETRAG"
/>
<column
name="WHG"
length="3"
/>
</property>
<property
name="datum"
type="java.util.Date"
update="true"
insert="true"
column="DATUM"
/>
<property
name="blz"
type="string"
update="true"
insert="true"
column="BLZ"
length="8"
/>
<property
name="empfaenger"
type="string"
update="true"
insert="true"
column="EMPFAENGER"
length="30"
/>
<property
name="kontonummer"
type="string"
update="true"
insert="true"
column="KTONR"
length="36"
/>
<property
name="zweck"
type="string"
update="true"
insert="true"
column="ZWECK"
length="150"
/>
<property
name="erstellungszeitpunkt"
type="timestamp"
update="true"
insert="true"
column="TIME_CREATED"
/>
<property
name="geaendertVon"
type="java.lang.String"
update="true"
insert="true"
column="MODIFIED_BY"
/>
</class>
</hibernate-mapping>
create table AUSZAHLUNG (
VOID VARCHAR2(32) not null,
TIME_MODIFIED DATE not null,
BETRAG DOUBLE PRECISION,
WHG VARCHAR2(3),
DATUM DATE,
BLZ VARCHAR2(8),
EMPFAENGER VARCHAR2(30),
KTONR VARCHAR2(36),
ZWECK VARCHAR2(150),
TIME_CREATED DATE,
MODIFIED_BY VARCHAR2(255),
LBAUST_ID VARCHAR2(32),
AUSZNR NUMBER(10,0),
primary key (VOID)
);
why do I get this exception ?
Thanks
|