Examples of AccessType


Examples of org.hibernate.annotations.AccessType

      explicitAccessType = superEntityState != null ?
          superEntityState.accessType :
          null;
    }
    else {
      AccessType access = clazzToProcess.getAnnotation( AccessType.class );
      explicitAccessType = access != null ?
          access.value() :
          null;
      if ( "property".equals( explicitAccessType ) ) {
        isExplicitPropertyAnnotated = Boolean.TRUE;
      }
      else if ( "field".equals( explicitAccessType ) ) {
View Full Code Here

Examples of org.hibernate.annotations.AccessType

  private static boolean addElementsOfAClass(
      List<PropertyData> elements, PropertyHolder propertyHolder, boolean isPropertyAnnotated,
      String propertyAccessor, final XClass annotatedClass, ExtendedMappings mappings
  ) {
    boolean hasIdentifier = false;
    AccessType access = annotatedClass.getAnnotation( AccessType.class );
    String localPropertyAccessor = access != null ?
        access.value() :
        null;
    String accessType = null;
    if ( "property".equals( localPropertyAccessor ) || "field".equals( localPropertyAccessor ) ) {
      accessType = localPropertyAccessor;
    }
View Full Code Here

Examples of org.hibernate.annotations.AccessType

      AnnotationDescriptor ad = new AnnotationDescriptor( AccessType.class );
      ad.setValue( "value", access );
      return AnnotationFactory.create( ad );
    }
    else if ( defaults.canUseJavaAnnotations() && isJavaAnnotationPresent( AccessType.class ) ) {
      AccessType annotation = getJavaAnnotation( AccessType.class );
      return annotation;
    }
    else if ( defaults.getAccess() != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( AccessType.class );
      ad.setValue( "value", defaults.getAccess() );
View Full Code Here

Examples of org.hibernate.annotations.AccessType

  }

  public String getDefaultAccess() throws MappingException {
    // if(skip())
    // return defaultAccess;
    AccessType access = property.getAnnotation( AccessType.class );
    return access != null ? access.value() : defaultAccess;
  }
View Full Code Here

Examples of org.hibernate.annotations.AccessType

  public void setPropertyAccessor(String propertyAccessor) {
    this.propertyAccessor = propertyAccessor;
  }

  public boolean isPropertyAnnotated(XAnnotatedElement element) {
    AccessType access = element.getAnnotation( AccessType.class );
    if ( access == null ) return isPropertyAnnotated;
    String propertyAccessor = access.value();
    if ( "property".equals( propertyAccessor ) ) {
      return Boolean.TRUE;
    }
    else if ( "field".equals( propertyAccessor ) ) {
      return Boolean.FALSE;
View Full Code Here

Examples of org.hibernate.annotations.AccessType

      return isPropertyAnnotated;
    }
  }

  public String getPropertyAccessor(XAnnotatedElement element) {
    AccessType access = element.getAnnotation( AccessType.class );
    if ( access == null ) return propertyAccessor;
    return access.value();
  }
View Full Code Here

Examples of org.hibernate.cache.access.AccessType

      model.prepareTemporaryTables( mapping, settings.getDialect() );
      final String cacheRegionName = cacheRegionPrefix + model.getRootClass().getCacheRegionName();
      // cache region is defined by the root-class in the hierarchy...
      EntityRegionAccessStrategy accessStrategy = ( EntityRegionAccessStrategy ) entityAccessStrategies.get( cacheRegionName );
      if ( accessStrategy == null && settings.isSecondLevelCacheEnabled() ) {
        final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
        if ( accessType != null ) {
          log.trace( "Building cache for entity data [" + model.getEntityName() + "]" );
          EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
          accessStrategy = entityRegion.buildAccessStrategy( accessType );
          entityAccessStrategies.put( cacheRegionName, accessStrategy );
          allCacheRegions.put( cacheRegionName, entityRegion );
        }
      }
      EntityPersister cp = PersisterFactory.createClassPersister( model, accessStrategy, this, mapping );
      entityPersisters.put( model.getEntityName(), cp );
      classMeta.put( model.getEntityName(), cp.getClassMetadata() );
    }
    classMetadata = Collections.unmodifiableMap(classMeta);

    Map tmpEntityToCollectionRoleMap = new HashMap();
    collectionPersisters = new HashMap();
    Iterator collections = cfg.getCollectionMappings();
    while ( collections.hasNext() ) {
      Collection model = (Collection) collections.next();
      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        log.trace( "Building cache for collection data [" + model.getRole() + "]" );
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
View Full Code Here

Examples of org.hibernate.cache.access.AccessType

      model.prepareTemporaryTables( mapping, settings.getDialect() );
      final String cacheRegionName = cacheRegionPrefix + model.getRootClass().getCacheRegionName();
      // cache region is defined by the root-class in the hierarchy...
      EntityRegionAccessStrategy accessStrategy = ( EntityRegionAccessStrategy ) entityAccessStrategies.get( cacheRegionName );
      if ( accessStrategy == null && settings.isSecondLevelCacheEnabled() ) {
        final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
        if ( accessType != null ) {
          log.trace( "Building cache for entity data [" + model.getEntityName() + "]" );
          EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
          accessStrategy = entityRegion.buildAccessStrategy( accessType );
          entityAccessStrategies.put( cacheRegionName, accessStrategy );
          allCacheRegions.put( cacheRegionName, entityRegion );
        }
      }
      EntityPersister cp = PersisterFactory.createClassPersister( model, accessStrategy, this, mapping );
      entityPersisters.put( model.getEntityName(), cp );
      classMeta.put( model.getEntityName(), cp.getClassMetadata() );
    }
    classMetadata = Collections.unmodifiableMap(classMeta);

    Map tmpEntityToCollectionRoleMap = new HashMap();
    collectionPersisters = new HashMap();
    Iterator collections = cfg.getCollectionMappings();
    while ( collections.hasNext() ) {
      Collection model = (Collection) collections.next();
      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        log.trace( "Building cache for collection data [" + model.getRole() + "]" );
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
View Full Code Here

Examples of org.hibernate.cache.access.AccessType

      model.prepareTemporaryTables( mapping, settings.getDialect() );
      final String cacheRegionName = cacheRegionPrefix + model.getRootClass().getCacheRegionName();
      // cache region is defined by the root-class in the hierarchy...
      EntityRegionAccessStrategy accessStrategy = ( EntityRegionAccessStrategy ) entityAccessStrategies.get( cacheRegionName );
      if ( accessStrategy == null && settings.isSecondLevelCacheEnabled() ) {
        final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
        if ( accessType != null ) {
          log.trace( "Building cache for entity data [" + model.getEntityName() + "]" );
          EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
          accessStrategy = entityRegion.buildAccessStrategy( accessType );
          entityAccessStrategies.put( cacheRegionName, accessStrategy );
          allCacheRegions.put( cacheRegionName, entityRegion );
        }
      }
      EntityPersister cp = PersisterFactory.createClassPersister( model, accessStrategy, this, mapping );
      entityPersisters.put( model.getEntityName(), cp );
      classMeta.put( model.getEntityName(), cp.getClassMetadata() );
    }
    classMetadata = Collections.unmodifiableMap(classMeta);

    Map tmpEntityToCollectionRoleMap = new HashMap();
    collectionPersisters = new HashMap();
    Iterator collections = cfg.getCollectionMappings();
    while ( collections.hasNext() ) {
      Collection model = (Collection) collections.next();
      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        log.trace( "Building cache for collection data [" + model.getRole() + "]" );
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
View Full Code Here

Examples of org.hibernate.cache.access.AccessType

      model.prepareTemporaryTables( mapping, settings.getDialect() );
      final String cacheRegionName = cacheRegionPrefix + model.getRootClass().getCacheRegionName();
      // cache region is defined by the root-class in the hierarchy...
      EntityRegionAccessStrategy accessStrategy = ( EntityRegionAccessStrategy ) entityAccessStrategies.get( cacheRegionName );
      if ( accessStrategy == null && settings.isSecondLevelCacheEnabled() ) {
        final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
        if ( accessType != null ) {
          log.trace( "Building cache for entity data [" + model.getEntityName() + "]" );
          EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
          accessStrategy = entityRegion.buildAccessStrategy( accessType );
          entityAccessStrategies.put( cacheRegionName, accessStrategy );
          allCacheRegions.put( cacheRegionName, entityRegion );
        }
      }
      EntityPersister cp = PersisterFactory.createClassPersister( model, accessStrategy, this, mapping );
      entityPersisters.put( model.getEntityName(), cp );
      classMeta.put( model.getEntityName(), cp.getClassMetadata() );
    }
    classMetadata = Collections.unmodifiableMap(classMeta);

    Map tmpEntityToCollectionRoleMap = new HashMap();
    collectionPersisters = new HashMap();
    Iterator collections = cfg.getCollectionMappings();
    while ( collections.hasNext() ) {
      Collection model = (Collection) collections.next();
      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        log.trace( "Building cache for collection data [" + model.getRole() + "]" );
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
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.