Examples of HibernateProxy


Examples of org.hibernate.proxy.HibernateProxy

      ProxyFactory factory = new ProxyFactory();
      factory.setSuperclass( interfaces.length == 1 ? persistentClass : null );
      factory.setInterfaces( interfaces );
      factory.setFilter( FINALIZE_FILTER );
      Class cl = factory.createClass();
      final HibernateProxy proxy = ( HibernateProxy ) cl.newInstance();
      ( ( Proxy ) proxy ).setHandler( instance );
      instance.constructed = true;
      return proxy;
    }
    catch ( Throwable t ) {
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

        componentIdType,
        session,
        classOverridesEquals
    );

    final HibernateProxy proxy;
    try {
      proxy = ( HibernateProxy ) factory.newInstance();
    }
    catch ( Exception e ) {
      throw new HibernateException(
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

        if ( isEmbeddedInXML ) {
          throw new ClassCastException( value.getClass().getName() );
        }
        id = ( Serializable ) value;
      } else if ( value instanceof HibernateProxy ) {
        HibernateProxy proxy = ( HibernateProxy ) value;
        id = proxy.getHibernateLazyInitializer().getIdentifier();
      }
      else {
        id = persister.getIdentifier( value );
      }
     
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

    if ( value instanceof ElementWrapper ) {
      value = ( (ElementWrapper) value ).getElement();
    }

    if ( !Hibernate.isInitialized( value ) ) {
      final HibernateProxy proxy = (HibernateProxy) value;
      final LazyInitializer li = proxy.getHibernateLazyInitializer();
      reassociateProxy( li, proxy );
      return true;
    }
    else {
      return false;
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

      value = ( (ElementWrapper) value ).getElement();
    }

    if ( value instanceof HibernateProxy ) {
      LOG.debugf( "Setting proxy identifier: %s", id );
      final HibernateProxy proxy = (HibernateProxy) value;
      final LazyInitializer li = proxy.getHibernateLazyInitializer();
      li.setIdentifier( id );
      reassociateProxy( li, proxy );
    }
  }
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

    if ( maybeProxy instanceof ElementWrapper ) {
      maybeProxy = ( (ElementWrapper) maybeProxy ).getElement();
    }

    if ( maybeProxy instanceof HibernateProxy ) {
      final HibernateProxy proxy = (HibernateProxy) maybeProxy;
      final LazyInitializer li = proxy.getHibernateLazyInitializer();
      if ( li.isUninitialized() ) {
        throw new PersistentObjectException(
            "object was an uninitialized proxy for " + li.getEntityName()
        );
      }
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

    if ( maybeProxy instanceof ElementWrapper ) {
      maybeProxy = ( (ElementWrapper) maybeProxy ).getElement();
    }

    if ( maybeProxy instanceof HibernateProxy ) {
      final HibernateProxy proxy = (HibernateProxy) maybeProxy;
      final LazyInitializer li = proxy.getHibernateLazyInitializer();
      reassociateProxy( li, proxy );
      //initialize + unwrap the object and return it
      return li.getImplementation();
    }
    else {
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

    //    of the loop-in-loop especially considering this is far more likely the 'edge case'
    if ( mergeMap != null ) {
      for ( Object o : mergeMap.entrySet() ) {
        final Entry mergeMapEntry = (Entry) o;
        if ( mergeMapEntry.getKey() instanceof HibernateProxy ) {
          final HibernateProxy proxy = (HibernateProxy) mergeMapEntry.getKey();
          if ( persister.isSubclassEntityName( proxy.getHibernateLazyInitializer().getEntityName() ) ) {
            boolean found = isFoundInParent(
                propertyName,
                childEntity,
                persister,
                collectionPersister,
                mergeMap.get( proxy )
            );
            if ( !found ) {
              found = isFoundInParent(
                  propertyName,
                  mergeMap.get( childEntity ),
                  persister,
                  collectionPersister,
                  mergeMap.get( proxy )
              );
            }
            if ( found ) {
              return proxy.getHibernateLazyInitializer().getIdentifier();
            }
          }
        }
      }
    }
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

    }
    if ( isReadOnly( object ) == readOnly ) {
      return;
    }
    if ( object instanceof HibernateProxy ) {
      final HibernateProxy proxy = (HibernateProxy) object;
      setProxyReadOnly( proxy, readOnly );
      if ( Hibernate.isInitialized( proxy ) ) {
        setEntityReadOnly(
            proxy.getHibernateLazyInitializer().getImplementation(),
            readOnly
        );
      }
    }
    else {
View Full Code Here

Examples of org.hibernate.proxy.HibernateProxy

    if ( value instanceof ElementWrapper ) {
      value = ( (ElementWrapper) value ).getElement();
    }
   
    if ( !Hibernate.isInitialized(value) ) {
      HibernateProxy proxy = (HibernateProxy) value;
      LazyInitializer li = proxy.getHibernateLazyInitializer();
      reassociateProxy(li, proxy);
      return true;
    }
    else {
      return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.