-->
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.  [ 2 posts ] 
Author Message
 Post subject: DefaultPostUpdateEventListener
PostPosted: Wed Jun 22, 2005 4:41 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 305

Mapping documents: not important

i wrote my event class like this:



Code:
    /* (non-Javadoc)
     * @see org.hibernate.event.def.DefaultPostUpdateEventListener#onPostUpdate(org.hibernate.event.PostUpdateEvent)
     */
    public void onPostUpdate(PostUpdateEvent event) {
        super.onPostUpdate(event);
        Object bean = event.getEntity();
        if (bean instanceof Parametro){
            Dominio oldDom = (Dominio)event.getOldState()[0];
            Dominio newDom = (Dominio)event.getState()[0];
            //Controllo che il codice dominio nuovo è diverso dal vecchio
            //se lo è cancello tutte le relazioni del parametro
            if (newDom.getCodint() != oldDom.getCodint()){
                Parametro par = (Parametro)bean;
                par.getRelazioni().removeAll(par.getRelazioni());
            }
        }
    }


The problem is: i think in event.getOldState() was store the old state of my bean but oldstate is always NULL. Why?

i need to compare the oldstate with new state of bean what could i do?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 3:03 am 
Beginner
Beginner

Joined: Wed Sep 07, 2005 9:57 am
Posts: 20
Hi foxmarco,

I have the same problem. Did you ever find an answer to this?

Thanks,
Ronald


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.