Code example for PersistenceContext

Methods: clearisLoadFinished

0
 
	public void refresh(String entityName, Object entity, LockMode lockMode) { 
		final EntityPersister persister = this.getEntityPersister( entityName, entity ); 
		final Serializable id = persister.getIdentifier( entity, this ); 
        if (LOG.isTraceEnabled()) LOG.trace("Refreshing transient " + MessageHelper.infoString(persister, id, this.getFactory())); 
		// TODO : can this ever happen??? 
//		EntityKey key = new EntityKey( id, persister, source.getEntityMode() ); 
//		if ( source.getPersistenceContext().getEntry( key ) != null ) { 
//			throw new PersistentObjectException( 
//					"attempted to refresh transient instance when persistent " + 
//					"instance was already associated with the Session: " + 
//					MessageHelper.infoString( persister, id, source.getFactory() ) 
//			); 
//		} 
 
		if ( persister.hasCache() ) { 
			final CacheKey ck = generateCacheKey( id, persister.getIdentifierType(), persister.getRootEntityName() ); 
			persister.getCacheAccessStrategy().evict( ck ); 
		} 
 
Connect your IDE to all the code out there  Get Codota for Java