Package org.jboss.jandex

Examples of org.jboss.jandex.AnnotationValue


      this.child = child;
    }

    @Override
    public boolean process(AnnotationInstance annotationInstance) {
      AnnotationValue value = annotationInstance.value();
      AnnotationInstance[] indexedAttributeOverridesValues = value.asNestedArray();
      for ( AnnotationInstance ai : indexedAttributeOverridesValues ) {
        child.process( ai );
      }
      return true;
    }
View Full Code Here


    if ( annotationInstanceList == null || annotationInstanceList.isEmpty() ) {
      return;
    }
    List<AnnotationInstance> newAnnotationInstanceList = new ArrayList<AnnotationInstance>( annotationInstanceList.size() );
    for ( AnnotationInstance annotationInstance : annotationInstanceList ) {
      AnnotationValue cascadeValue = annotationInstance.value( "cascade" );
      List<AnnotationValue> newAnnotationValueList = new ArrayList<AnnotationValue>();
      newAnnotationValueList.addAll( annotationInstance.values() );
      if ( cascadeValue == null ) {
        AnnotationValue temp = AnnotationValue.createEnumValue( "", JPADotNames.CASCADE_TYPE, "PERSIST" );
        cascadeValue = AnnotationValue.createArrayValue( "cascade", new AnnotationValue[] { temp } );
      }
      else {
        newAnnotationValueList.remove( cascadeValue );
        String[] cascadeTypes = cascadeValue.asEnumArray();
View Full Code Here

      for ( AnnotationInstance ai : annotationInstances ) {
        pushIfNotExist( ai );
      }
    }
    else {
      AnnotationValue value = annotationInstance.value( "name" );
      String name = value.asString();
      isNotExist = ( annName.equals( TABLE_GENERATOR ) && !tableGeneratorMap.containsKey( name ) ) ||
          ( annName.equals( SEQUENCE_GENERATOR ) && !sequenceGeneratorMap.containsKey( name ) ) ||
          ( annName.equals( NAMED_QUERY ) && !namedQueryMap.containsKey( name ) ) ||
          ( annName.equals( NAMED_NATIVE_QUERY ) && !namedNativeQueryMap.containsKey( name ) ) ||
          ( annName.equals( SQL_RESULT_SET_MAPPING ) && !sqlResultSetMappingMap.containsKey( name ) );
View Full Code Here

          flushMode, cacheMode, readOnly, comment,
          null, callable
      );
    }
    else {
      AnnotationValue annotationValue = annotation.value( "resultClass" );
      if ( annotationValue == null ) {
        throw new NotYetImplementedException( "Pure native scalar queries are not yet supported" );
      }
      NativeSQLQueryRootReturn queryRoots[] = new NativeSQLQueryRootReturn[] {
          new NativeSQLQueryRootReturn(
              "alias1",
              annotationValue.asString(),
              new HashMap<String, String[]>(),
              LockMode.READ
          )
      };
      def = new NamedSQLQueryDefinition(
View Full Code Here

    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() );
      }
    }

    return NotFoundAction.IGNORE.equals( action );
  }
View Full Code Here

  }

  private boolean determineOptionality(AnnotationInstance associationAnnotation) {
    boolean optional = true;

    AnnotationValue optionalValue = associationAnnotation.value( "optional" );
    if ( optionalValue != null ) {
      optional = optionalValue.asBoolean();
    }

    return optional;
  }
View Full Code Here

    return optional;
  }

  private boolean determineOrphanRemoval(AnnotationInstance associationAnnotation) {
    boolean orphanRemoval = false;
    AnnotationValue orphanRemovalValue = associationAnnotation.value( "orphanRemoval" );
    if ( orphanRemovalValue != null ) {
      orphanRemoval = orphanRemovalValue.asBoolean();
    }
    return orphanRemoval;
  }
View Full Code Here

    return orphanRemoval;
  }

  private boolean determineFetchType(AnnotationInstance associationAnnotation) {
    boolean lazy = false;
    AnnotationValue fetchValue = associationAnnotation.value( "fetch" );
    if ( fetchValue != null ) {
      FetchType fetchType = Enum.valueOf( FetchType.class, fetchValue.asEnum() );
      if ( FetchType.LAZY.equals( fetchType ) ) {
        lazy = true;
      }
    }
    return lazy;
View Full Code Here

    );
    if ( targetAnnotation != null ) {
      targetTypeName = targetAnnotation.value().asClass().name().toString();
    }

    AnnotationValue targetEntityValue = associationAnnotation.value( "targetEntity" );
    if ( targetEntityValue != null ) {
      targetTypeName = targetEntityValue.asClass().name().toString();
    }

    return targetTypeName;
  }
View Full Code Here

    return targetTypeName;
  }

  private String determineMappedByAttributeName(AnnotationInstance associationAnnotation) {
    String mappedBy = null;
    AnnotationValue mappedByAnnotationValue = associationAnnotation.value( "mappedBy" );
    if ( mappedByAnnotationValue != null ) {
      mappedBy = mappedByAnnotationValue.asString();
    }

    return mappedBy;
  }
View Full Code Here

TOP

Related Classes of org.jboss.jandex.AnnotationValue

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.