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

This code example shows how to use the following methods:
This code example shows how to use the following methods:
	 * @param proxy The proxy to reassociate. 
	 */ 
	private void reassociateProxy(LazyInitializer li, HibernateProxy proxy) { 
		if ( li.getSession() != this.getSession() ) { 
			final EntityPersister persister = session.getFactory().getEntityPersister( li.getEntityName() ); 
			final EntityKey key = session.generateEntityKey( li.getIdentifier(), persister ); 
		  	// any earlier proxy takes precedence 
			if ( !proxiesByKey.containsKey( key ) ) { 
				proxiesByKey.put( key, proxy ); 
			} 
			proxy.getHibernateLazyInitializer().setSession( session ); 
		} 
	} 
 
	/** 
	 * Get the entity instance underlying the given proxy, throwing 
	 * an exception if the proxy is uninitialized. If the given object 
	 * is not a proxy, simply return the argument. 
	 */ 
	public Object unproxy(Object maybeProxy) throws HibernateException { 
1
CodeRank
Connect your IDE to all the code out there  Get Codota for Java