code: private Object getReferencedEntity(int propertyIndex) {
  		Object referencedEntity = null;
  
  		GridType propertyType = persister.getGridPropertyTypes()[propertyIndex];
  		Serializable id = (Serializable) propertyType.hydrate(
  				resultset, persister.getPropertyColumnNames( propertyIndex ), session, null
  		);
  
  		if ( id != null ) {
  			EntityPersister hostingEntityPersister = session.getFactory().getMetamodel().entityPersister(
  					propertyType.getReturnedClass()
  			);
  
  			// OGM-931 Loading the entity through Session#get() to make sure it is fetched from the store if it is
  			// detached atm. but also to benefit from 2L caching etc.
  			Class<?> entityType = hostingEntityPersister.getMappedClass();
  			referencedEntity = ( (Session) session ).get( entityType, id );
  
  			// In case the entity is scheduled for deletion, obtain it from the PC
  			if ( referencedEntity == null ) {
  				referencedEntity = session.getPersistenceContext().getEntity(
  					session.generateEntityKey( id, hostingEntityPersister )
  				);
  			}
  		}
  
  		return referencedEntity;
  	}
docs: Returns the object referenced by the specified property (which represents an association).