-->
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: Update verison of non dirty Entity
PostPosted: Wed Oct 26, 2005 9:26 pm 
Senior
Senior

Joined: Sat Sep 10, 2005 3:46 pm
Posts: 178
Is there anyway to update the version of an entity without actually changing any of its data?

I have an instance where I need to manipulate some related objects to an entity but the entity doesn't hold a direct association to those objects in the mappings. When one of the related entities is updated, I want nhibernate to update the version of the main entity. Is this possible?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 27, 2005 9:58 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Long time ago, I had the inverse problem: I enabled cascading between two objects and whenever I saved the first, the version of the second was updated...

So you might enable cascading and see if you get the desired behaviour :wink:

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 27, 2005 12:30 pm 
Senior
Senior

Joined: Sat Sep 10, 2005 3:46 pm
Posts: 178
Maybe I didnt set it up right but it didnt have the effect I was looking for. On a many to one assosciation, I set this mapping up:

Code:
<many-to-one name="parent" column="parentId" access="field.camelcase-underscore" not-null="true" cascade="save-update" />



This mapping did not cause the parent's version to get updated. Basically nothing ever happened to the parent on add, update, delete.

Any other ideas? Do I need another mapping on the other end? I'm trying to avoid the list mapping on the parent due to performance problems with collection mappings.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:08 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You can add the collection mapping and enable lazy loading; there will be no performance impact.

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.