/** * Resolve an identifier via a load. * * @param id The entity id to resolve * @param session The orginating session. * * @return The resolved identifier (i.e., loaded entity). * * @throws org.hibernate.HibernateException Indicates problems performing the load. */ protected final Object resolveIdentifier(Serializable id, SharedSessionContractImplementor session, Boolean overridingEager) throws HibernateException { boolean isProxyUnwrapEnabled = unwrapProxy && getAssociatedEntityPersister( session.getFactory() ) .isInstrumented(); boolean eager = overridingEager != null ? overridingEager : this.eager; Object proxyOrEntity = session.internalLoad( getAssociatedEntityName(), id, eager, isNullable() ); if ( proxyOrEntity instanceof HibernateProxy ) { ( (HibernateProxy) proxyOrEntity ).getHibernateLazyInitializer() .setUnwrap( isProxyUnwrapEnabled ); } return proxyOrEntity; }
@Override public void setUnwrap(boolean unwrap) { this.lazyInitializer.setUnwrap(unwrap); }
/** * Resolve an identifier via a load. * * @param id The entity id to resolve * @param session The orginating session. * @return The resolved identifier (i.e., loaded entity). * @throws org.hibernate.HibernateException Indicates problems performing the load. */ protected final Object resolveIdentifier(Serializable id, SessionImplementor session) throws HibernateException { boolean isProxyUnwrapEnabled = unwrapProxy && session.getFactory() .getEntityPersister( getAssociatedEntityName() ) .isInstrumented( session.getEntityMode() ); Object proxyOrEntity = session.internalLoad( getAssociatedEntityName(), id, eager, isNullable() && !isProxyUnwrapEnabled ); if ( proxyOrEntity instanceof HibernateProxy ) { ( ( HibernateProxy ) proxyOrEntity ).getHibernateLazyInitializer() .setUnwrap( isProxyUnwrapEnabled ); } return proxyOrEntity; }
/** * Resolve an identifier via a load. * * @param id The entity id to resolve * @param session The orginating session. * @return The resolved identifier (i.e., loaded entity). * @throws org.hibernate.HibernateException Indicates problems performing the load. */ protected final Object resolveIdentifier(Serializable id, SessionImplementor session) throws HibernateException { boolean isProxyUnwrapEnabled = unwrapProxy && session.getFactory() .getEntityPersister( getAssociatedEntityName() ) .isInstrumented(); Object proxyOrEntity = session.internalLoad( getAssociatedEntityName(), id, eager, isNullable() && !isProxyUnwrapEnabled ); if ( proxyOrEntity instanceof HibernateProxy ) { ( ( HibernateProxy ) proxyOrEntity ).getHibernateLazyInitializer() .setUnwrap( isProxyUnwrapEnabled ); } return proxyOrEntity; }
/** * Resolve an identifier via a load. * * @param id The entity id to resolve * @param session The orginating session. * @return The resolved identifier (i.e., loaded entity). * @throws org.hibernate.HibernateException Indicates problems performing the load. */ protected final Object resolveIdentifier(Serializable id, SessionImplementor session) throws HibernateException { boolean isProxyUnwrapEnabled = unwrapProxy && session.getFactory() .getEntityPersister( getAssociatedEntityName() ) .isInstrumented(); Object proxyOrEntity = session.internalLoad( getAssociatedEntityName(), id, eager, isNullable() && !isProxyUnwrapEnabled ); if ( proxyOrEntity instanceof HibernateProxy ) { ( ( HibernateProxy ) proxyOrEntity ).getHibernateLazyInitializer() .setUnwrap( isProxyUnwrapEnabled ); } return proxyOrEntity; }