-->
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: auto update when setting value
PostPosted: Thu Feb 21, 2008 3:56 pm 
Beginner
Beginner

Joined: Thu Feb 21, 2008 3:31 pm
Posts: 34
Hi all,

I started implementing an auto update for one class, but had a question before I used it. In my bean, I have support for firing events to notify that a property was changed. In the constructor, I initialize a listener that listens for any property change. When a change occurs, it calls a private update function which basically updates the object in the database.

I was wondering, are there any ramifications of doing it this way? I wanted the classes to automatically handle persistence so any changes made will be taken care of internally.

Maybe it would be better to just provide a public function that can be called to update whenever so this class doesn't make 5 calls to the db when it could just make 1. I think I will still use the property change support.


Walter


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.