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

This code example shows how to use the following methods:
		Object entity = getEntity(key); 
		if ( entity == object ) { 
			throw new AssertionFailure( "object already associated, but no entry was found" ); 
		} 
		if ( entity != null ) { 
			throw new NonUniqueObjectException( key.getIdentifier(), key.getEntityName() ); 
		} 
	} 
 
	/** 
	 * If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy 
	 * and overwrite the registration of the old one. This breaks == and occurs only for 
	 * "class" proxies rather than "interface" proxies. Also init the proxy to point to 
	 * the given target implementation if necessary. 
	 * 
	 * @param proxy The proxy instance to be narrowed. 
	 * @param persister The persister for the proxied entity. 
	 * @param key The internal cache key for the proxied entity. 
	 * @param object (optional) the actual proxied entity instance. 
	 * @return An appropriately narrowed instance. 
1
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java