-->
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.  [ 4 posts ] 
Author Message
 Post subject: Interceptor : onFlushDirty method
PostPosted: Mon Nov 29, 2004 9:49 am 
Regular
Regular

Joined: Tue Oct 07, 2003 1:13 pm
Posts: 70
Location: Paris, France
Hibernate version: 2.1.7

I've extended the AuditLog interceptor to track and save the change of value.
Everythink works well, except for a OneToMany association mapped as Array . If I change the values of the array, onFlushDirty is never called ....
What's wrong?
Richard.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 5:35 am 
Regular
Regular

Joined: Tue Oct 07, 2003 1:13 pm
Posts: 70
Location: Paris, France
In my interceptor, I'm sure the method OnFlushDirty is never called when my entity has its array 'paramed" changed. Is it normal ?

I'd like to add the mapping of my array :

<array
name="paramed"
table="vic_paramed"
inverse="false"
cascade="all"
>

<key
column="vic_id"
/>

<index
column="indice"
type="int"
/>

<composite-element
class="com.Paramed"
>
<property
name="adresse"
type="java.lang.String"
update="true"
insert="true"
column="adresse"
length="100"
/>

<property
name="nom"
type="java.lang.String"
update="true"
insert="true"
column="nom"
length="50"
/>

<property
name="prenom"
type="java.lang.String"
update="true"
insert="true"
column="prenom"
length="30"
/>

<many-to-one
name="specialite"
class="com.ParamedSpecialite"
cascade="none"
outer-join="false"
update="true"
insert="true"
column="specialite_id"
/>

<property
name="tel"
type="java.lang.String"
update="true"
insert="true"
column="tel"
length="10"
/>

</composite-element>

</array>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 5:37 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
That might be a missing feature. Please note that arrays are also not very efficient and typically not used, as explained in the "Performance" chapter of the reference docs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 12:07 pm 
Regular
Regular

Joined: Tue Oct 07, 2003 1:13 pm
Posts: 70
Location: Paris, France
Ok, I've replaced the array type by a list type, and that is the same problem.
A change in my OneToMany association doesn't trigger a call to the onFlushDirty of my interceptor.
That is a very big problem for me, because I can log every value change except for my OneToMany association.
Actually I've touched the problem :
COLLECTIONS DON'T DIRTY AN UNVERSIONNED PARENT ENTITY !!!!!!
Aaarg I'm dead... Must i turn to version my entity to have the right that Hibernate calls the onFlushDirty ?????? Or is there a workaround ? I dont' know ... maybe recompute a value change in the findDirty(...) method of my interceptor ?
Please, have you any pointers ???
Thank you.
Richard


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.