-->
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: Listener for saving and loading objects
PostPosted: Thu May 03, 2007 9:10 am 
Beginner
Beginner

Joined: Fri Jun 23, 2006 6:28 am
Posts: 22
Hi

I defined two listener, one for encryping data befor it is saved in the DB, and one for decrypting the data after it is loaded from the DB:

Code:
<event type="post-load">
      <listener class="ch.hibernateplugin.EncryptionLoadListener"/>
      <listener class="org.hibernate.event.def.DefaultPostLoadEventListener"/>
    </event>
    <event type="save-update">
      <listener class="ch.hibernateplugin.EncryptionSaveOrUpdateListener"/>
      <listener class="org.hibernate.event.def.DefaultSaveOrUpdateEventListener"/>
</event>



Are these the correct Listeners, or should I use a PreInsertEventListener? The DefaultPostLoadEventListener works perfectly, but the save-update event type only works when I call session.refresh().

Greets


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.