Best code examples for Hibernate ORM NonUniqueObjectException class (org.hibernate.NonUniqueObjectException)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM NonUniqueObjectException class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM NonUniqueObjectException examples from Open Source projects
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. 
Full Snippet Info
1
CodeRank