Java Code Examples for org.hibernate.persister.entity.EntityPersister.implementsLifecycle()

The following are Jave code examples for showing how to use implementsLifecycle() of the org.hibernate.persister.entity.EntityPersister class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: lams   File: DefaultDeleteEventListener.java   View Source Code Vote up 5 votes
protected boolean invokeDeleteLifecycle(EventSource session, Object entity, EntityPersister persister) {
	if ( persister.implementsLifecycle() ) {
		LOG.debug( "Calling onDelete()" );
		if ( ( (Lifecycle) entity ).onDelete( session ) ) {
			LOG.debug( "Deletion vetoed by onDelete()" );
			return true;
		}
	}
	return false;
}
 
Example 2
Project: lams   File: DefaultSaveOrUpdateEventListener.java   View Source Code Vote up 5 votes
protected boolean invokeUpdateLifecycle(Object entity, EntityPersister persister, EventSource source) {
	if ( persister.implementsLifecycle() ) {
		LOG.debug( "Calling onUpdate()" );
		if ( ( (Lifecycle) entity ).onUpdate( source ) ) {
			LOG.debug( "Update vetoed by onUpdate()" );
			return true;
		}
	}
	return false;
}
 
Example 3
Project: lams   File: AbstractSaveEventListener.java   View Source Code Vote up 5 votes
protected boolean invokeSaveLifecycle(Object entity, EntityPersister persister, EventSource source) {
	// Sub-insertions should occur before containing insertion so
	// Try to do the callback now
	if ( persister.implementsLifecycle() ) {
		LOG.debug( "Calling onSave()" );
		if ( ((Lifecycle) entity).onSave( source ) ) {
			LOG.debug( "Insertion vetoed by onSave()" );
			return true;
		}
	}
	return false;
}