-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Pulling back objects that join two tables calls upadate..?
PostPosted: Fri Jul 22, 2005 10:05 am 
Newbie

Joined: Thu Jun 30, 2005 6:36 am
Posts: 4
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>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 11:12 am 
Newbie

Joined: Thu Jun 30, 2005 6:36 am
Posts: 4
This is fixed - was a problem with hibernate blob -> byte arrays


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.