Package java.lang.annotation

Examples of java.lang.annotation.Annotation


        annotationList.add( AnnotationFactory.create( ad ) );
        eventElement = true;
      }
    }
    if ( !eventElement && defaults.canUseJavaAnnotations() ) {
      Annotation ann = getJavaAnnotation( PrePersist.class );
      addIfNotNull( annotationList, ann );
      ann = getJavaAnnotation( PreRemove.class );
      addIfNotNull( annotationList, ann );
      ann = getJavaAnnotation( PreUpdate.class );
      addIfNotNull( annotationList, ann );
View Full Code Here


        addTargetClass( element, ad, "target-entity", defaults );
        getFetchType( ad, element );
        getCascades( ad, element, defaults );
        getJoinTable( annotationList, element, defaults );
        buildJoinColumns( annotationList, element);
        Annotation annotation = getPrimaryKeyJoinColumns( element, defaults );
        addIfNotNull( annotationList, annotation );
        copyBooleanAttribute( ad, element, "optional" );
        copyStringAttribute( ad, element, "mapped-by", false );
        getOrderBy( annotationList, element );
        getMapKey( annotationList, element );
        annotationList.add( AnnotationFactory.create( ad ) );
        getAccessType( annotationList, element );
      }
    }
    if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
      Annotation annotation = getJavaAnnotation( annotationType );
      if ( annotation != null ) {
        annotationList.add( annotation );
        annotation = overridesDefaultsInJoinTable( annotation, defaults );
        addIfNotNull( annotationList, annotation );
        annotation = getJavaAnnotation( JoinColumn.class );
View Full Code Here

        annotationList.add( AnnotationFactory.create( ad ) );
        getAccessType( annotationList, element );
      }
    }
    if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
      Annotation annotation = getJavaAnnotation( Embedded.class );
      if ( annotation != null ) {
        annotationList.add( annotation );
        annotation = getJavaAnnotation( AttributeOverride.class );
        addIfNotNull( annotationList, annotation );
        annotation = getJavaAnnotation( AttributeOverrides.class );
View Full Code Here

        if ( transientAnn != null ) {
          annotationList.add( transientAnn );
        }
        else {
          if ( defaults.canUseJavaAnnotations() ) {
            Annotation annotation = getJavaAnnotation( Access.class );
            addIfNotNull( annotationList, annotation );
          }
          getId( annotationList, defaults );
          getEmbeddedId( annotationList, defaults );
          getEmbedded( annotationList, defaults );
View Full Code Here

        annotationList.add( AnnotationFactory.create( ad ) );
        eventElement = true;
      }
    }
    if ( !eventElement && defaults.canUseJavaAnnotations() ) {
      Annotation ann = getJavaAnnotation( PrePersist.class );
      addIfNotNull( annotationList, ann );
      ann = getJavaAnnotation( PreRemove.class );
      addIfNotNull( annotationList, ann );
      ann = getJavaAnnotation( PreUpdate.class );
      addIfNotNull( annotationList, ann );
View Full Code Here

        addTargetClass( element, ad, "target-entity", defaults );
        getFetchType( ad, element );
        getCascades( ad, element, defaults );
        getJoinTable( annotationList, element, defaults );
        buildJoinColumns( annotationList, element );
        Annotation annotation = getPrimaryKeyJoinColumns( element, defaults, false );
        addIfNotNull( annotationList, annotation );
        copyBooleanAttribute( ad, element, "optional" );
        copyBooleanAttribute( ad, element, "orphan-removal" );
        copyStringAttribute( ad, element, "mapped-by", false );
        getOrderBy( annotationList, element );
        getMapKey( annotationList, element );
        getMapKeyClass( annotationList, element, defaults );
        getMapKeyColumn( annotationList, element );
        getOrderColumn( annotationList, element );
        getMapKeyTemporal( annotationList, element );
        getMapKeyEnumerated( annotationList, element );
        annotation = getMapKeyAttributeOverrides( element, defaults );
        addIfNotNull( annotationList, annotation );
        buildMapKeyJoinColumns( annotationList, element );
        getAssociationId( annotationList, element );
        getMapsId( annotationList, element );
        annotationList.add( AnnotationFactory.create( ad ) );
        getAccessType( annotationList, element );
      }
    }
    if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
      Annotation annotation = getJavaAnnotation( annotationType );
      if ( annotation != null ) {
        annotationList.add( annotation );
        annotation = overridesDefaultsInJoinTable( annotation, defaults );
        addIfNotNull( annotationList, annotation );
        annotation = getJavaAnnotation( JoinColumn.class );
View Full Code Here

        getMapKeyClass( annotationList, element, defaults );
        getMapKeyTemporal( annotationList, element );
        getMapKeyEnumerated( annotationList, element );
        getMapKeyColumn( annotationList, element );
        buildMapKeyJoinColumns( annotationList, element );
        Annotation annotation = getColumn( element.element( "column" ), false, element );
        addIfNotNull( annotationList, annotation );
        getTemporal( annotationList, element );
        getEnumerated( annotationList, element );
        getLob( annotationList, element );
        //Both map-key-attribute-overrides and attribute-overrides
View Full Code Here

  private void getEmbedded(List<Annotation> annotationList, XMLContext.Default defaults) {
    for ( Element element : elementsForProperty ) {
      if ( "embedded".equals( element.getName() ) ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( Embedded.class );
        annotationList.add( AnnotationFactory.create( ad ) );
        Annotation annotation = getAttributeOverrides( element, defaults, false );
        addIfNotNull( annotationList, annotation );
        annotation = getAssociationOverrides( element, defaults, false );
        addIfNotNull( annotationList, annotation );
        getAccessType( annotationList, element );
      }
    }
    if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
      Annotation annotation = getJavaAnnotation( Embedded.class );
      if ( annotation != null ) {
        annotationList.add( annotation );
        annotation = getJavaAnnotation( AttributeOverride.class );
        addIfNotNull( annotationList, annotation );
        annotation = getJavaAnnotation( AttributeOverrides.class );
View Full Code Here

  }

  private void getVersion(List<Annotation> annotationList, XMLContext.Default defaults) {
    for ( Element element : elementsForProperty ) {
      if ( "version".equals( element.getName() ) ) {
        Annotation annotation = buildColumns( element );
        addIfNotNull( annotationList, annotation );
        getTemporal( annotationList, element );
        AnnotationDescriptor basic = new AnnotationDescriptor( Version.class );
        annotationList.add( AnnotationFactory.create( basic ) );
        getAccessType( annotationList, element );
      }
    }
    if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
      //we have nothing, so Java annotations might occurs
      Annotation annotation = getJavaAnnotation( Version.class );
      if ( annotation != null ) {
        annotationList.add( annotation );
        annotation = getJavaAnnotation( Column.class );
        addIfNotNull( annotationList, annotation );
        annotation = getJavaAnnotation( Columns.class );
View Full Code Here

  }

  private void getBasic(List<Annotation> annotationList, XMLContext.Default defaults) {
    for ( Element element : elementsForProperty ) {
      if ( "basic".equals( element.getName() ) ) {
        Annotation annotation = buildColumns( element );
        addIfNotNull( annotationList, annotation );
        getAccessType( annotationList, element );
        getTemporal( annotationList, element );
        getLob( annotationList, element );
        getEnumerated( annotationList, element );
        AnnotationDescriptor basic = new AnnotationDescriptor( Basic.class );
        getFetchType( basic, element );
        copyBooleanAttribute( basic, element, "optional" );
        annotationList.add( AnnotationFactory.create( basic ) );
      }
    }
    if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
      //no annotation presence constraint, basic is the default
      Annotation annotation = getJavaAnnotation( Basic.class );
      addIfNotNull( annotationList, annotation );
      annotation = getJavaAnnotation( Lob.class );
      addIfNotNull( annotationList, annotation );
      annotation = getJavaAnnotation( Enumerated.class );
      addIfNotNull( annotationList, annotation );
View Full Code Here

TOP

Related Classes of java.lang.annotation.Annotation

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.