Package org.jboss.jandex

Examples of org.jboss.jandex.AnnotationInstance


              secondaryTableAnnotationInstanceArray[i],
              defaults
          )
          );
        }
        AnnotationInstance secondaryTablesAnnotationInstance = MockHelper.create(
            annName,
            annotationInstance.target(),
            new AnnotationValue[] {
                AnnotationValue.createArrayValue( "value", newAnnotationValueArray )
            }
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

    return new CompositeAttributeTypeResolver( new AttributeTypeResolverImpl( this ) );
  }

  private boolean ignoreNotFound() {
    NotFoundAction action = NotFoundAction.EXCEPTION;
    AnnotationInstance notFoundAnnotation = JandexHelper.getSingleAnnotation(
        annotations(),
        HibernateDotNames.NOT_FOUND
    );
    if ( notFoundAnnotation != null ) {
      AnnotationValue actionValue = notFoundAnnotation.value( "action" );
      if ( actionValue != null ) {
        action = Enum.valueOf( NotFoundAction.class, actionValue.asEnum() );
      }
    }
View Full Code Here

  }

  private String determineReferencedEntityType(AnnotationInstance associationAnnotation) {
    String targetTypeName = getAttributeType().getName();

    AnnotationInstance targetAnnotation = JandexHelper.getSingleAnnotation(
        annotations(),
        HibernateDotNames.TARGET
    );
    if ( targetAnnotation != null ) {
      targetTypeName = targetAnnotation.value().asClass().name().toString();
    }

    AnnotationValue targetEntityValue = associationAnnotation.value( "targetEntity" );
    if ( targetEntityValue != null ) {
      targetTypeName = targetEntityValue.asClass().name().toString();
View Full Code Here

  }

  private FetchMode determineFetchMode() {
    FetchMode mode = FetchMode.DEFAULT;

    AnnotationInstance fetchAnnotation = JandexHelper.getSingleAnnotation( annotations(), HibernateDotNames.FETCH );
    if ( fetchAnnotation != null ) {
      org.hibernate.annotations.FetchMode annotationFetchMode = JandexHelper.getEnumValue(
          fetchAnnotation,
          "value",
          org.hibernate.annotations.FetchMode.class
View Full Code Here

    return mode;
  }

  private String determineMapsId() {
    String referencedIdAttributeName;
    AnnotationInstance mapsIdAnnotation = JandexHelper.getSingleAnnotation( annotations(), JPADotNames.MAPS_ID );
    if ( mapsIdAnnotation == null ) {
      return null;
    }

    if ( !( AttributeNature.MANY_TO_ONE.equals( getAssociationNature() ) || AttributeNature.MANY_TO_ONE
View Full Code Here

    if ( info == null ) {
      return false;
    }

    // we are only interested in building the class hierarchies for @Entity
    AnnotationInstance jpaEntityAnnotation = JandexHelper.getSingleAnnotation( info, JPADotNames.ENTITY );
    if ( jpaEntityAnnotation == null ) {
      return false;
    }

    // some sanity checks
    AnnotationInstance mappedSuperClassAnnotation = JandexHelper.getSingleAnnotation(
        info, JPADotNames.MAPPED_SUPERCLASS
    );
    String className = info.toString();
    assertNotEntityAndMappedSuperClass( jpaEntityAnnotation, mappedSuperClassAnnotation, className );

    AnnotationInstance embeddableAnnotation = JandexHelper.getSingleAnnotation(
        info, JPADotNames.EMBEDDABLE
    );
    assertNotEntityAndEmbeddable( jpaEntityAnnotation, embeddableAnnotation, className );

    return true;
View Full Code Here

    if ( info == null ) {
      return false;
    }

    // we are only interested in building the class hierarchies for @Entity
    AnnotationInstance mappedSuperclassAnnotation = JandexHelper.getSingleAnnotation(
        info,
        JPADotNames.MAPPED_SUPERCLASS
    );
    return mappedSuperclassAnnotation != null;
  }
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.