Package org.hibernate.jpamodelgen.annotation

Examples of org.hibernate.jpamodelgen.annotation.AnnotationMetaEntity$TypeVisitor


    List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();

    for ( AnnotationMirror mirror : annotationMirrors ) {
      if ( element.getKind() == ElementKind.CLASS ) {
        if ( TypeUtils.isAnnotationMirrorOfType( mirror, Entity.class ) ) {
          AnnotationMetaEntity metaEntity = new AnnotationMetaEntity( ( TypeElement ) element, context );
          // TODO instead of just adding the entity we have to do some merging.
          context.getMetaEntitiesToProcess().put( metaEntity.getQualifiedName(), metaEntity );
        }
        else if ( TypeUtils.isAnnotationMirrorOfType( mirror, MappedSuperclass.class )
            || TypeUtils.isAnnotationMirrorOfType( mirror, Embeddable.class ) ) {
          AnnotationMetaEntity metaEntity = new AnnotationMetaEntity( ( TypeElement ) element, context );

          // TODO instead of just adding the entity we have to do some merging.
          context.getMetaSuperclassAndEmbeddableToProcess().put( metaEntity.getQualifiedName(), metaEntity );
        }
      }
    }
  }
View Full Code Here


  public void processElement(TypeElement element, AccessType defaultAccessTypeForHierarchy) {
    if ( elementsAlreadyProcessed.contains( element.getQualifiedName().toString() ) ) {
      logMessage( Diagnostic.Kind.OTHER, "Element already processed (ignoring): " + element );
      return;
    }
    ClassWriter.writeFile( new AnnotationMetaEntity( element, this, defaultAccessTypeForHierarchy ), this );
    TypeUtils.extractClosestRealTypeAsString( element.asType(), this );
    elementsAlreadyProcessed.add( element.getQualifiedName().toString() );
  }
View Full Code Here

        String msg = "Skipping processing of annotations for " + fqn + " since xml configuration is metadata complete.";
        context.logMessage( Diagnostic.Kind.OTHER, msg );
        continue;
      }

      AnnotationMetaEntity metaEntity;
      if ( TypeUtils.containsAnnotation( element, Embeddable.class ) ) {
        metaEntity = new AnnotationEmbeddable( (TypeElement) element, context );
      }
      else {
        metaEntity = new AnnotationMetaEntity( (TypeElement) element, context );
      }

      if ( alreadyExistingMetaEntity != null ) {
        metaEntity.mergeInMembers( alreadyExistingMetaEntity.getMembers() );
      }
      addMetaEntityToContext( mirror, metaEntity );
    }
  }
View Full Code Here

        String msg = "Skipping processing of annotations for " + fqn + " since xml configuration is metadata complete.";
        context.logMessage( Diagnostic.Kind.OTHER, msg );
        continue;
      }

      AnnotationMetaEntity metaEntity;
      if ( TypeUtils.containsAnnotation( element, Constants.EMBEDDABLE ) ) {
        metaEntity = new AnnotationEmbeddable( (TypeElement) element, context );
      }
      else {
        metaEntity = new AnnotationMetaEntity( (TypeElement) element, context );
      }

      if ( alreadyExistingMetaEntity != null ) {
        metaEntity.mergeInMembers( alreadyExistingMetaEntity.getMembers() );
      }
      addMetaEntityToContext( mirror, metaEntity );
    }
  }
View Full Code Here

        context.logMessage( Diagnostic.Kind.OTHER, msg );
        continue;
      }

      boolean requiresLazyMemberInitialization = false;
      AnnotationMetaEntity metaEntity;
      if ( TypeUtils.containsAnnotation( element, Constants.EMBEDDABLE ) ||
          TypeUtils.containsAnnotation( element, Constants.MAPPED_SUPERCLASS ) ) {
        requiresLazyMemberInitialization = true;
      }

      metaEntity = new AnnotationMetaEntity( (TypeElement) element, context, requiresLazyMemberInitialization );

      if ( alreadyExistingMetaEntity != null ) {
        metaEntity.mergeInMembers( alreadyExistingMetaEntity );
      }
      addMetaEntityToContext( mirror, metaEntity );
    }
  }
View Full Code Here

        String msg = "Skipping processing of annotations for " + fqn + " since xml configuration is metadata complete.";
        context.logMessage( Diagnostic.Kind.OTHER, msg );
        continue;
      }

      AnnotationMetaEntity metaEntity;
      if ( TypeUtils.containsAnnotation( element, Embeddable.class ) ) {
        metaEntity = new AnnotationEmbeddable( ( TypeElement ) element, context );
      }
      else {
        metaEntity = new AnnotationMetaEntity( ( TypeElement ) element, context );
      }

      if ( alreadyExistingMetaEntity != null ) {
        metaEntity.mergeInMembers( alreadyExistingMetaEntity.getMembers() );
      }
      addMetaEntityToContext( mirror, metaEntity );
    }
  }
View Full Code Here

        String msg = "Skipping processing of annotations for " + fqn + " since xml configuration is metadata complete.";
        context.logMessage( Diagnostic.Kind.OTHER, msg );
        continue;
      }

      AnnotationMetaEntity metaEntity;
      if ( TypeUtils.containsAnnotation( element, Embeddable.class ) ) {
        metaEntity = new AnnotationEmbeddable( (TypeElement) element, context );
      }
      else {
        metaEntity = new AnnotationMetaEntity( (TypeElement) element, context );
      }

      if ( alreadyExistingMetaEntity != null ) {
        metaEntity.mergeInMembers( alreadyExistingMetaEntity.getMembers() );
      }
      addMetaEntityToContext( mirror, metaEntity );
    }
  }
View Full Code Here

        context.logMessage( Diagnostic.Kind.OTHER, msg );
        continue;
      }

      boolean requiresLazyMemberInitialization = false;
      AnnotationMetaEntity metaEntity;
      if ( TypeUtils.containsAnnotation( element, Constants.EMBEDDABLE ) ||
          TypeUtils.containsAnnotation( element, Constants.MAPPED_SUPERCLASS ) ) {
        requiresLazyMemberInitialization = true;
      }

      metaEntity = new AnnotationMetaEntity( (TypeElement) element, context, requiresLazyMemberInitialization );

      if ( alreadyExistingMetaEntity != null ) {
        metaEntity.mergeInMembers( alreadyExistingMetaEntity );
      }
      addMetaEntityToContext( mirror, metaEntity );
    }
  }
View Full Code Here

    for ( AnnotationMirror mirror : annotationMirrors ) {
      final String annotationType = mirror.getAnnotationType().toString();

      if ( element.getKind() == ElementKind.CLASS ) {
        if ( annotationType.equals( ENTITY_ANN ) ) {
          AnnotationMetaEntity metaEntity = new AnnotationMetaEntity( ( TypeElement ) element, context );
          // TODO instead of just adding the entity we have to do some merging.
          context.getMetaEntitiesToProcess().put( metaEntity.getQualifiedName(), metaEntity );
        }
        else if ( annotationType.equals( MAPPED_SUPERCLASS_ANN )
            || annotationType.equals( EMBEDDABLE_ANN ) ) {
          AnnotationMetaEntity metaEntity = new AnnotationMetaEntity( ( TypeElement ) element, context );

          // TODO instead of just adding the entity we have to do some merging.
          context.getMetaSuperclassAndEmbeddableToProcess().put( metaEntity.getQualifiedName(), metaEntity );
        }
      }
    }
  }
View Full Code Here

  public void processElement(TypeElement element, AccessType defaultAccessTypeForHierarchy) {
    if ( elementsAlreadyProcessed.contains( element.getQualifiedName().toString() ) ) {
      logMessage( Diagnostic.Kind.WARNING, "Element already processed (ignoring): " + element );
      return;
    }
    ClassWriter.writeFile( new AnnotationMetaEntity( element, this, defaultAccessTypeForHierarchy ), this );
    elementsAlreadyProcessed.add( element.getQualifiedName().toString() );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.jpamodelgen.annotation.AnnotationMetaEntity$TypeVisitor

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.