Hibernate ORM ObjectDeletedException - 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 ObjectDeletedException class.

This code example shows how to use the following methods:
		// 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; 
		} 
	} 
	 
	/** 
	 * If the user specified an id, assign it to the instance and use that,  
	 * otherwise use the id already assigned to the instance 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE