Package org.jboss.jandex

Examples of org.jboss.jandex.AnnotationInstance


    }
    this.customPersister = entityPersisterClass;
  }

  private Caching determineCachingSettings() {
    final AnnotationInstance hibernateCacheAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.CACHE
    );
    if ( hibernateCacheAnnotation != null ) {
      final org.hibernate.cache.spi.access.AccessType accessType = hibernateCacheAnnotation.value( "usage" ) == null
          ? getLocalBindingContext().getMappingDefaults().getCacheAccessType()
          : CacheConcurrencyStrategy.parse( hibernateCacheAnnotation.value( "usage" ).asEnum() )
          .toAccessType();
      return new Caching(
          hibernateCacheAnnotation.value( "region" ) == null
              ? getName()
              : hibernateCacheAnnotation.value( "region" ).asString(),
          accessType,
          hibernateCacheAnnotation.value( "include" ) != null
              && "all".equals( hibernateCacheAnnotation.value( "include" ).asString() )
      );
    }

    final AnnotationInstance jpaCacheableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), JPADotNames.CACHEABLE
    );

    boolean cacheable = true; // true is the default
    if ( jpaCacheableAnnotation != null && jpaCacheableAnnotation.value() != null ) {
      cacheable = jpaCacheableAnnotation.value().asBoolean();
    }

    final boolean doCaching;
    switch ( getLocalBindingContext().getMetadataImplementor().getOptions().getSharedCacheMode() ) {
      case ALL: {
View Full Code Here


    return tableSourceImpl;
  }

  private Set<TableSource> createSecondaryTableSources() {
    Set<TableSource> secondaryTableSources = new HashSet<TableSource>();
    AnnotationInstance secondaryTables = JandexHelper.getSingleAnnotation(
        getClassInfo(),
        JPADotNames.SECONDARY_TABLES
    );
    AnnotationInstance secondaryTable = JandexHelper.getSingleAnnotation(
        getClassInfo(),
        JPADotNames.SECONDARY_TABLE
    );
    // collect all @secondaryTable annotations
    List<AnnotationInstance> secondaryTableAnnotations = new ArrayList<AnnotationInstance>();
View Full Code Here

  }

  private String determineCustomLoader() {
    String customLoader = null;
    // Custom sql loader
    final AnnotationInstance sqlLoaderAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.LOADER
    );
    if ( sqlLoaderAnnotation != null ) {
      customLoader = sqlLoaderAnnotation.value( "namedQuery" ).asString();
    }
    return customLoader;
  }
View Full Code Here

    return new CustomSQL( sql, isCallable, checkStyle );
  }

  private void processCustomSqlAnnotations() {
    // Custom sql insert
    final AnnotationInstance sqlInsertAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.SQL_INSERT
    );
    customInsert = createCustomSQL( sqlInsertAnnotation );

    // Custom sql update
    final AnnotationInstance sqlUpdateAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.SQL_UPDATE
    );
    customUpdate = createCustomSQL( sqlUpdateAnnotation );

    // Custom sql delete
    final AnnotationInstance sqlDeleteAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.SQL_DELETE
    );
    customDelete = createCustomSQL( sqlDeleteAnnotation );
  }
View Full Code Here

    );
    customDelete = createCustomSQL( sqlDeleteAnnotation );
  }

  private List<String> determineSynchronizedTableNames() {
    final AnnotationInstance synchronizeAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.SYNCHRONIZE
    );
    if ( synchronizeAnnotation != null ) {
      final String[] tableNames = synchronizeAnnotation.value().asStringArray();
      return Arrays.asList( tableNames );
    }
    else {
      return Collections.emptyList();
    }
View Full Code Here

    }
  }

  private void processProxyGeneration() {
    // Proxy generation
    final AnnotationInstance hibernateProxyAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.PROXY
    );
    if ( hibernateProxyAnnotation != null ) {
      isLazy = hibernateProxyAnnotation.value( "lazy" ) == null
          || hibernateProxyAnnotation.value( "lazy" ).asBoolean();
      if ( isLazy ) {
        final AnnotationValue proxyClassValue = hibernateProxyAnnotation.value( "proxyClass" );
        if ( proxyClassValue == null ) {
          proxy = getName();
        }
        else {
          proxy = proxyClassValue.asString();
View Full Code Here

      proxy = getName();
    }
  }

  private int determineBatchSize() {
    final AnnotationInstance batchSizeAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.BATCH_SIZE
    );
    return batchSizeAnnotation == null ? -1 : batchSizeAnnotation.value( "size" ).asInt();
  }
View Full Code Here

    this.name = name;
    this.attributeType = attributeType;
    this.accessType = accessType;

    //if this attribute has either @Id or @EmbeddedId, then it is an id attribute
    AnnotationInstance idAnnotation = JandexHelper.getSingleAnnotation( annotations, JPADotNames.ID );
    AnnotationInstance embeddedIdAnnotation = JandexHelper.getSingleAnnotation(
        annotations,
        JPADotNames.EMBEDDED_ID
    );
    isId = ( idAnnotation != null || embeddedIdAnnotation != null );

    AnnotationInstance columnAnnotation = JandexHelper.getSingleAnnotation(
        annotations,
        JPADotNames.COLUMN
    );
    columnValues = new ColumnValues( columnAnnotation );
View Full Code Here

  public abstract PropertyGeneration getPropertyGeneration();

  private boolean checkOptimisticLockAnnotation() {
    boolean triggersVersionIncrement = true;
    AnnotationInstance optimisticLockAnnotation = JandexHelper.getSingleAnnotation(
        annotations(),
        HibernateDotNames.OPTIMISTIC_LOCK
    );
    if ( optimisticLockAnnotation != null ) {
      boolean exclude = optimisticLockAnnotation.value( "excluded" ).asBoolean();
      triggersVersionIncrement = !exclude;
    }
    return triggersVersionIncrement;
  }
View Full Code Here

                 EntityBindingContext context) {
    super( name, javaType, accessType, annotations, context );
    this.associationNature = associationType;
    this.ignoreNotFound = ignoreNotFound();

    AnnotationInstance associationAnnotation = JandexHelper.getSingleAnnotation(
        annotations,
        associationType.getAnnotationDotName()
    );

    // using jandex we don't really care which exact type of annotation we are dealing with
View Full Code Here

TOP

Related Classes of org.jboss.jandex.AnnotationInstance

Copyright © 2018 www.massapicom. 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.