FileDocCategorySizeDatePackage
DefaultSaveEventListener.javaAPI DocHibernate 3.2.51621Sat Oct 29 05:32:46 BST 2005org.hibernate.event.def

DefaultSaveEventListener

public class DefaultSaveEventListener extends DefaultSaveOrUpdateEventListener
An event handler for save() events
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
protected java.io.SerializableperformSaveOrUpdate(org.hibernate.event.SaveOrUpdateEvent event)

		// this implementation is supposed to tolerate incorrect unsaved-value
		// mappings, for the purpose of backward-compatibility
		EntityEntry entry = event.getSession().getPersistenceContext().getEntry( event.getEntity() );
		if ( entry!=null && entry.getStatus() != Status.DELETED ) {
			return entityIsPersistent(event);
		}
		else {
			return entityIsTransient(event);
		}
	
protected booleanreassociateIfUninitializedProxy(java.lang.Object object, org.hibernate.engine.SessionImplementor source)

		if ( !Hibernate.isInitialized(object) ) {
			throw new PersistentObjectException("uninitialized proxy passed to save()");
		}
		else {
			return false;
		}
	
protected java.io.SerializablesaveWithGeneratedOrRequestedId(org.hibernate.event.SaveOrUpdateEvent event)

		if ( event.getRequestedId() == null ) {
			return super.saveWithGeneratedOrRequestedId(event);
		}
		else {
			return saveWithRequestedId( 
					event.getEntity(), 
					event.getRequestedId(), 
					event.getEntityName(), 
					null, 
					event.getSession() 
				);
		}