-->
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: How does one modify property prior to saving/updating
PostPosted: Wed Feb 27, 2008 6:51 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 11:45 am
Posts: 46
Specifically, i have a class (or 2) in which i want to check to see if an item is null, If so, i need to make perform some calculations and go to the DB to change it.

I have used listeners and trapped the class of interest. However, any change i make to the property does not take place. Null is still inserted into the db.

In fact, it appears that i can't make any changes to elements onFlush or onSaveOrUpdate.

Is there another listener i should use? (onDirtyCheck?) Should i be using an interceptor? Is what i'm trying to do possible (i sure hope so).

There is little docmentation on listeners, and most examples are listeners that write audits, etc. None that i can find actually change the value of a property on the persistent entity.

Is there any place that details precisely what is doable on each event?

any help would be appreciated.

_________________
Please rate this reply if it helps!!


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.