Examples of LoadState


Examples of javax.persistence.spi.LoadState

    public class ForwardingProviderUtil implements ProviderUtil {

        public LoadState isLoadedWithReference(Object entity, String attributeName) {
            Collection<PersistenceProvider> providers = lookupProviders();
            for (PersistenceProvider provider : providers) {
                LoadState loadstate = provider.getProviderUtil().isLoadedWithReference(entity, attributeName);
                if (loadstate != LoadState.UNKNOWN) {
                    return loadstate;
                } // else keep looking
            }
            // None of the providers knew, so the load state is unknown
View Full Code Here

Examples of javax.persistence.spi.LoadState

        }

        public LoadState isLoadedWithoutReference(Object entity, String attributeName) {
            Collection<PersistenceProvider> providers = lookupProviders();
            for (PersistenceProvider provider : providers) {
                LoadState loadstate = provider.getProviderUtil().isLoadedWithoutReference(entity, attributeName);
                if (loadstate != LoadState.UNKNOWN) {
                    return loadstate;
                } // else keep looking
            }
            // None of the providers knew, so the load state is unknown
View Full Code Here

Examples of javax.persistence.spi.LoadState

        }

        public LoadState isLoaded(Object entity) {
            Collection<PersistenceProvider> providers = lookupProviders();
            for (PersistenceProvider provider : providers) {
                LoadState loadstate = provider.getProviderUtil().isLoaded(entity);
                if (loadstate != LoadState.UNKNOWN) {
                    return loadstate;
                } // else keep looking
            }
            // None of the providers knew, so the load state is unknown
View Full Code Here

Examples of javax.persistence.spi.LoadState

    public class ForwardingProviderUtil implements ProviderUtil {

        public LoadState isLoadedWithReference(Object entity, String attributeName) {
            Collection<PersistenceProvider> providers = lookupProviders();
            for (PersistenceProvider provider : providers) {
                LoadState loadstate = provider.getProviderUtil().isLoadedWithReference(entity, attributeName);
                if (loadstate != LoadState.UNKNOWN) {
                    return loadstate;
                } // else keep looking
            }
            // None of the providers knew, so the load state is unknown
View Full Code Here

Examples of javax.persistence.spi.LoadState

        }

        public LoadState isLoadedWithoutReference(Object entity, String attributeName) {
            Collection<PersistenceProvider> providers = lookupProviders();
            for (PersistenceProvider provider : providers) {
                LoadState loadstate = provider.getProviderUtil().isLoadedWithoutReference(entity, attributeName);
                if (loadstate != LoadState.UNKNOWN) {
                    return loadstate;
                } // else keep looking
            }
            // None of the providers knew, so the load state is unknown
View Full Code Here

Examples of javax.persistence.spi.LoadState

        }

        public LoadState isLoaded(Object entity) {
            Collection<PersistenceProvider> providers = lookupProviders();
            for (PersistenceProvider provider : providers) {
                LoadState loadstate = provider.getProviderUtil().isLoaded(entity);
                if (loadstate != LoadState.UNKNOWN) {
                    return loadstate;
                } // else keep looking
            }
            // None of the providers knew, so the load state is unknown
View Full Code Here

Examples of javax.persistence.spi.LoadState

      this.emf = emf;
      this.cache = emf.cache;
    }

    public boolean isLoaded(Object entity, String attributeName) {
      LoadState state = PersistenceUtilHelper.isLoadedWithoutReference( entity, attributeName, cache );
      if (state == LoadState.LOADED) {
        return true;
      }
      else if (state == LoadState.NOT_LOADED ) {
        return false;
View Full Code Here

Examples of javax.persistence.spi.LoadState

    //we are instrumenting but we can't assume we are the only ones
    if ( FieldInterceptionHelper.isInstrumented( entity ) ) {
      FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor( entity );
      final boolean isInitialized = interceptor == null || interceptor.isInitialized( property );
      LoadState state;
      if (isInitialized && interceptor != null) {
        //property is loaded according to bytecode enhancement, but is it loaded as far as association?
        //it's ours, we can read
        state = isLoaded( get( entity, property, cache ) );
        //it's ours so we know it's loaded
View Full Code Here

Examples of javax.persistence.spi.LoadState

    }

    public boolean isLoaded(Object entity, String attributeName) {
      // added log message to help with HHH-7454, if state == LoadState,NOT_LOADED, returning true or false is not accurate.
      log.debug("PersistenceUnitUtil#isLoaded is not always accurate; consider using EntityManager#contains instead");
      LoadState state = PersistenceUtilHelper.isLoadedWithoutReference( entity, attributeName, cache );
      if (state == LoadState.LOADED) {
        return true;
      }
      else if (state == LoadState.NOT_LOADED ) {
        return false;
View Full Code Here

Examples of javax.persistence.spi.LoadState

    //we are instrumenting but we can't assume we are the only ones
    if ( FieldInterceptionHelper.isInstrumented( entity ) ) {
      FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor( entity );
      final boolean isInitialized = interceptor == null || interceptor.isInitialized( property );
      LoadState state;
      if (isInitialized && interceptor != null) {
        //property is loaded according to bytecode enhancement, but is it loaded as far as association?
        //it's ours, we can read
        state = isLoaded( get( entity, property, cache ) );
        //it's ours so we know it's loaded
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.