I encountered a strange problem, I would really appreciate help.
I have a mapping of a list within another class:
A.hbm.xml contains:
<cache usage="read-write"/>
<id name="id" type="long" column="ID">
<generator class="sequence"/>
</id>
<list name="values" lazy="false" fetch="subselect" outer-join="true" cascade="all,delete-orphan">
<cache usage="read-write"/>
<key column="A_ID"/>
<index column="POSITION"/>
<one-to-many class="B"/>
</list>
B.hbm.xml contains:
<cache usage="read-write"/>
<id name="id" type="long" column="ID">
<generator class="sequence"/>
</id>
<component name="C" class="C">
<property name="value" type="string" column="VALUE" length="4000"/>
<property name="extraData" type="string" column="EXTRA_DATA"/>
</component>
The application's flow is:
Each time the data is saved in the DB, new Bs are created.
The list is cleared and rebuilt with new Bs: one that contains 'C.value' (some string) and the other B's C is null. This usually works OK, the existing rows are deleted from the DB and new ones are created with new IDs.
However, when setting a value in B (the filled one) that is longer than 1000 characters, the other row (in which the value is null) gets messed up: the id in the DB is 0 and the value is filled (?) with a few characters like "?>".
Thank you.
|