Hibernate ORM SaveOrUpdateEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM SaveOrUpdateEvent class.

This code example shows how to use the following methods: getEntity, getEntityName, getRequestedId, getSession
			return entityIsTransient(event);
		} 
	} 
	 
	protected Serializable saveWithGeneratedOrRequestedId(SaveOrUpdateEvent event) {
		if ( event.getRequestedId() == null ) {
			return super.saveWithGeneratedOrRequestedId(event);
		} 
		else { 
			return saveWithRequestedId(  
					event.getEntity(), 
					event.getRequestedId(), 
					event.getEntityName(), 
					null,  
					event.getSession() 
				); 
		} 
		 
	} 
 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getEntity, getSession
public class DefaultUpdateEventListener extends DefaultSaveOrUpdateEventListener {
 
	protected Serializable performSaveOrUpdate(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 ) {
			if ( entry.getStatus()== Status.DELETED ) {
				throw new ObjectDeletedException( "deleted instance passed to update()", null, event.getEntityName() );
			} 
			else { 
				return entityIsPersistent(event);
			} 
		} 
		else { 
			entityIsDetached(event);
			return null; 
		} 
	} 
	 
	/** 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE