-->
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.  [ 1 post ] 
Author Message
 Post subject: Finddirty with relationship table
PostPosted: Tue Dec 07, 2010 11:13 am 
Newbie

Joined: Tue Dec 07, 2010 10:29 am
Posts: 2
Hi.
I implemented a partial update using the interceptor method FindDirty. The system works well except for the only relationship table that is persisted every time I flush, indipendent of response of FindDirty. I tried also to returns always an empty array from FindDirty, and still that table is persisted, obviuosly any other change isn't persisted.

The class is:
<class name="TaxonomyClass" table="CLASS" lazy="true">
<id name="Code">
<column name="CLASS_CODE"/>
<generator class="assigned" />
</id>
<property name="Name" />
<property name="Description" />
<many-to-one name="OwnerTaxonomyDomain" column="TAXONOMYDOMAIN" class="Taxonomy" cascade="none"/>
<many-to-one name="ClassParent" column="PARENT" class="TaxonomyClass" cascade="none"/>
<bag name ="ListSampleDoc" cascade="all" lazy="true" inverse="true" fetch="select">
<key column="CLASS"/>
<one-to-many class="SampleDocument"/>
</bag>
<bag name ="ListOwnerTaxonomyClassifiers" table="CLASSIFIERCLASSES" cascade="none" lazy="true" >
<key column="CLASS"/>
<many-to-many class="Taxonomy" column="TAXONOMYCLASSIFIER" not-found="ignore"/>
</bag>

<!--<bag name ="ListChild" cascade="all-delete-orphan" lazy="false">
<key column="PARENT"/>
<one-to-many class="TaxonomyClass"/>
</bag>-->
</class>

In bold the definition of relationship table.
FindDirty is:
public override int[] FindDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types)
{
int[] iRet = null;
/*if (SessionManager.EntityToSave == null ||
entity == SessionManager.EntityToSave ||
(bool)ArianeReflection.Invoke(entity, "IsInWeb", new object[]{SessionManager.EntityToSave}))
iRet = base.FindDirty(entity, id, currentState, previousState, propertyNames, types);
else*/
iRet = new int[] { };
return iRet;
}


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

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.