ch.elca.el4j.services.persistence.hibernate
Class HibernatePersistentCollectionRefresher

java.lang.Object
  extended by ch.elca.el4j.services.persistence.hibernate.HibernatePersistentCollectionRefresher
All Implemented Interfaces:
Serializable, PostCollectionRecreateEventListener, PostCollectionUpdateEventListener

public class HibernatePersistentCollectionRefresher
extends Object
implements PostCollectionRecreateEventListener, PostCollectionUpdateEventListener

This Hibernate event listener refreshes all persisted sets and maps. This is a workaround for all entities based on AbstractIntKeyIntOptimisticLockingDto because they change their hash code during the persistence process. Therefore collections based on hash code have to be refreshed such that the new hash code is used. Otherwise inserted entities won't be found anymore after persisting.

Author:
Stefan Wismer (SWI)
See Also:
Serialized Form
File-location:
HibernatePersistentCollectionRefresher
Last check-in date:
2009-08-04 14:35:53 +0200 (Di, 04. Aug 2009) by swismer for revision 3875

Constructor Summary
HibernatePersistentCollectionRefresher()
           
 
Method Summary
 void onPostRecreateCollection(PostCollectionRecreateEvent event)
          
 void onPostUpdateCollection(PostCollectionUpdateEvent event)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernatePersistentCollectionRefresher

public HibernatePersistentCollectionRefresher()
Method Detail

onPostRecreateCollection

public void onPostRecreateCollection(PostCollectionRecreateEvent event)

Specified by:
onPostRecreateCollection in interface PostCollectionRecreateEventListener

onPostUpdateCollection

public void onPostUpdateCollection(PostCollectionUpdateEvent event)

Specified by:
onPostUpdateCollection in interface PostCollectionUpdateEventListener


Copyright © 2005-2011 ELCA. All Rights Reserved.