Examples of AnnotationDescriptor


Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

   * associations.
   */
  private void getMapsId(List<Annotation> annotationList, Element element) {
    String attrVal = element.attributeValue( "maps-id" );
    if ( attrVal != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( MapsId.class );
      ad.setValue( "value", attrVal );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

   * associations.
   */
  private void getAssociationId(List<Annotation> annotationList, Element element) {
    String attrVal = element.attributeValue( "id" );
    if ( "true".equals( attrVal ) ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( Id.class );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

   * context.
   */
  private void getElementCollection(List<Annotation> annotationList, XMLContext.Default defaults) {
    for ( Element element : elementsForProperty ) {
      if ( "element-collection".equals( element.getName() ) ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( ElementCollection.class );
        addTargetClass( element, ad, "target-class", defaults );
        getFetchType( ad, element );
        getOrderBy( annotationList, element );
        getOrderColumn( annotationList, element );
        getMapKey( annotationList, element );
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

  }

  private void getOrderBy(List<Annotation> annotationList, Element element) {
    Element subelement = element != null ? element.element( "order-by" ) : null;
    if ( subelement != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( OrderBy.class );
      copyStringElement( subelement, ad, "value" );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

  }

  private void getMapKey(List<Annotation> annotationList, Element element) {
    Element subelement = element != null ? element.element( "map-key" ) : null;
    if ( subelement != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( MapKey.class );
      copyStringAttribute( ad, subelement, "name", false );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

  }

  private void getMapKeyColumn(List<Annotation> annotationList, Element element) {
    Element subelement = element != null ? element.element( "map-key-column" ) : null;
    if ( subelement != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyColumn.class );
      copyStringAttribute( ad, subelement, "name", false );
      copyBooleanAttribute( ad, subelement, "unique" );
      copyBooleanAttribute( ad, subelement, "nullable" );
      copyBooleanAttribute( ad, subelement, "insertable" );
      copyBooleanAttribute( ad, subelement, "updatable" );
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

  private void getMapKeyClass(List<Annotation> annotationList, Element element, XMLContext.Default defaults) {
    String nodeName = "map-key-class";
    Element subelement = element != null ? element.element( nodeName ) : null;
    if ( subelement != null ) {
      String mapKeyClassName = subelement.attributeValue( "class" );
      AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyClass.class );
      if ( StringHelper.isNotEmpty( mapKeyClassName ) ) {
        Class clazz;
        try {
          clazz = ReflectHelper.classForName(
              XMLContext.buildSafeClassName( mapKeyClassName, defaults ),
              this.getClass()
          );
        }
        catch ( ClassNotFoundException e ) {
          throw new AnnotationException(
              "Unable to find " + element.getPath() + " " + nodeName + ": " + mapKeyClassName, e
          );
        }
        ad.setValue( "value", clazz );
      }
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

  }

  private void getCollectionTable(List<Annotation> annotationList, Element element, XMLContext.Default defaults) {
    Element subelement = element != null ? element.element( "collection-table" ) : null;
    if ( subelement != null ) {
      AnnotationDescriptor annotation = new AnnotationDescriptor( CollectionTable.class );
      copyStringAttribute( annotation, subelement, "name", false );
      copyStringAttribute( annotation, subelement, "catalog", false );
      if ( StringHelper.isNotEmpty( defaults.getCatalog() )
          && StringHelper.isEmpty( (String) annotation.valueOf( "catalog" ) ) ) {
        annotation.setValue( "catalog", defaults.getCatalog() );
      }
      copyStringAttribute( annotation, subelement, "schema", false );
      if ( StringHelper.isNotEmpty( defaults.getSchema() )
          && StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) ) ) {
        annotation.setValue( "schema", defaults.getSchema() );
      }
      JoinColumn[] joinColumns = getJoinColumns( subelement, false );
      if ( joinColumns.length > 0 ) {
        annotation.setValue( "joinColumns", joinColumns );
      }
      buildUniqueConstraints( annotation, subelement );
      annotationList.add( AnnotationFactory.create( annotation ) );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

  }

  private void buildJoinColumns(List<Annotation> annotationList, Element element) {
    JoinColumn[] joinColumns = getJoinColumns( element, false );
    if ( joinColumns.length > 0 ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( JoinColumns.class );
      ad.setValue( "value", joinColumns );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor

  }

  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 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.