-->
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: DefaultSaveOrUpdateEventListener re-sets properties. Why?
PostPosted: Mon Aug 28, 2006 1:31 pm 
Newbie

Joined: Mon Aug 21, 2006 10:41 am
Posts: 2
Hibernate version: 3.1.2

I'm hoping someone will be able to explain an aspect of the way Hibernate works that has been causing me considerable difficulty. I'll try to be as quick and specific as possible and would be happy to just be directed to wherever I should be reading.

I have a Hibernate entity in a web application. I set various properties on an instance of this entity and save it. As part of saving the object, Hibernate seems to call all of the object's setter methods again, to re-set the properties, even though the new values being passed to the setters are the same as the existing property values. On one level, this seems redundant. On another level, I'd like one of the setters to have a side-effect so that it would matter when and where it was called. The stack trace when this re-setting occurs is as given below. The object that initiates it is an instance of DefaultSaveOrUpdateEventListener. Can anyone enlighten me as to why this happens and perhaps even how I can influence it?

Thanks in advance,

John.


PojoEntityTuplizer.setPropertyValues(Object, Object[]) line: 184

SingleTableEntityPersister(AbstractEntityPersister).setPropertyValues(Object, Object[], EntityMode) line: 3232

DefaultSaveOrUpdateEventListener(AbstractSaveEventListener).performSaveOrReplicate(Object, EntityKey, EntityPersister, boolean, Object, EventSource) line: 253

DefaultSaveOrUpdateEventListener(AbstractSaveEventListener).performSave(Object, Serializable, EntityPersister, boolean, Object, EventSource) line: 167

DefaultSaveOrUpdateEventListener(AbstractSaveEventListener).saveWithGeneratedId(Object, String, Object, EventSource) line: 114

DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(SaveOrUpdateEvent) line: 186

DefaultSaveOrUpdateEventListener.entityIsTransient(SaveOrUpdateEvent) line: 175

DefaultSaveOrUpdateEventListener.performSaveOrUpdate(SaveOrUpdateEvent) line: 98

DefaultSaveOrUpdateEventListener.onSaveOrUpdate(SaveOrUpdateEvent) line: 70


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.