I have what seems like a very odd situation.
I have an Image Object (id and filename) which has a ref to a DataObject (the image byte[] data).
when pulling back the images the following sql is ran
select image0_.id as id, image0_.filename as filename9_ from Image image0_
followed by a series of...
select data0_.id as id0_, data0_.data as data5_0_ from Data data0_ where data0_.id=?
which i expect but then...
update Data set data=? where id=?
???
why is update being called..
the update is also called everytime i pull back an object that has a reference to an image.
any help would be great
these are the mapping files ..
<hibernate-mapping>
<class name="Image">
<id name="id" column="id">
<generator class="identity"/>
</id>
<property name="filename"/>
<one-to-one name="dataObj"
class="Data"
cascade="save-update"
lazy="true"
/>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="Data">
<id name="id" column="id">
<generator class="identity"/>
</id>
<property name="dataBlob" column="data" type="blob"/>
</class>
</hibernate-mapping>
|