Code example for ObjectDeletedException

0
		// 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 
Contextual code suggestions in your IDE  Get Codota for Java