Examples of AnnotationDescriptor


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

    final Class<JoinTable> annotationType = JoinTable.class;
    if ( subelement == null ) {
      return null;
    }
    //ignore java annotation, an element is defined
    AnnotationDescriptor annotation = new AnnotationDescriptor( annotationType );
    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() );
    }
    buildUniqueConstraints( annotation, subelement );
    annotation.setValue( "joinColumns", getJoinColumns( subelement, false ) );
    annotation.setValue( "inverseJoinColumns", getJoinColumns( subelement, true ) );
    return AnnotationFactory.create( annotation );
  }
View Full Code Here

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

      Class<? extends Annotation> annotationType, List<Annotation> annotationList, XMLContext.Default defaults
  ) {
    String xmlName = annotationToXml.get( annotationType );
    for ( Element element : elementsForProperty ) {
      if ( xmlName.equals( element.getName() ) ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( annotationType );
        addTargetClass( element, ad, "target-entity", defaults );
        getFetchType( ad, element );
        getCascades( ad, element, defaults );
        getJoinTable( annotationList, element, defaults );
        buildJoinColumns( annotationList, element );
View Full Code Here

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

  }

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

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

  private MapKeyJoinColumn[] getMapKeyJoinColumns(Element element) {
    List<Element> subelements = element != null ? element.elements( "map-key-join-column" ) : null;
    List<MapKeyJoinColumn> joinColumns = new ArrayList<MapKeyJoinColumn>();
    if ( subelements != null ) {
      for ( Element subelement : subelements ) {
        AnnotationDescriptor column = new AnnotationDescriptor( MapKeyJoinColumn.class );
        copyStringAttribute( column, subelement, "name", false );
        copyStringAttribute( column, subelement, "referenced-column-name", false );
        copyBooleanAttribute( column, subelement, "unique" );
        copyBooleanAttribute( column, subelement, "nullable" );
        copyBooleanAttribute( column, subelement, "insertable" );
View Full Code Here

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

   * element-collection, many-to-many, or one-to-many associations.
   */
  private void getMapKeyEnumerated(List<Annotation> annotationList, Element element) {
    Element subelement = element != null ? element.element( "map-key-enumerated" ) : null;
    if ( subelement != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyEnumerated.class );
      EnumType value = EnumType.valueOf( subelement.getTextTrim() );
      ad.setValue( "value", value );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

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

    }
    return filters;
  }

  private static FullTextFilterDef createFullTextFilterDef(Map<String, Object> filterDef) {
    AnnotationDescriptor fullTextFilterDefAnnotation = new AnnotationDescriptor( FullTextFilterDef.class );
    for ( Entry<String, Object> entry : filterDef.entrySet() ) {
      fullTextFilterDefAnnotation.setValue( entry.getKey(), entry.getValue() );
    }

    return AnnotationFactory.create( fullTextFilterDefAnnotation );
  }
View Full Code Here

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

    }
    return filters;
  }

  private AnalyzerDef createAnalyzerDef(Map<String, Object> analyzerDef) {
    AnnotationDescriptor analyzerDefAnnotation = new AnnotationDescriptor( AnalyzerDef.class );
    for ( Map.Entry<String, Object> entry : analyzerDef.entrySet() ) {
      if ( entry.getKey().equals( "tokenizer" ) ) {
        AnnotationDescriptor tokenizerAnnotation = new AnnotationDescriptor( TokenizerDef.class );
        @SuppressWarnings("unchecked")
        Map<String, Object> tokenizer = (Map<String, Object>) entry.getValue();
        for ( Map.Entry<String, Object> tokenizerEntry : tokenizer.entrySet() ) {
          if ( tokenizerEntry.getKey().equals( "params" ) ) {
            addParamsToAnnotation( tokenizerAnnotation, tokenizerEntry );
          }
          else {
            tokenizerAnnotation.setValue( tokenizerEntry.getKey(), tokenizerEntry.getValue() );
          }
        }
        analyzerDefAnnotation.setValue( "tokenizer", AnnotationFactory.create( tokenizerAnnotation ) );
      }
      else if ( entry.getKey().equals( "filters" ) ) {
View Full Code Here

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

  private TokenFilterDef[] createFilters(List<Map<String, Object>> filters) {
    TokenFilterDef[] filtersArray = new TokenFilterDef[filters.size()];
    int index = 0;
    for ( Map<String, Object> filter : filters ) {
      AnnotationDescriptor filterAnn = new AnnotationDescriptor( TokenFilterDef.class );
      for ( Map.Entry<String, Object> filterEntry : filter.entrySet() ) {
        if ( filterEntry.getKey().equals( "params" ) ) {
          addParamsToAnnotation( filterAnn, filterEntry );
        }
        else {
          filterAnn.setValue( filterEntry.getKey(), filterEntry.getValue() );
        }
      }
      filtersArray[index] = AnnotationFactory.create( filterAnn );
      index++;
    }
View Full Code Here

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

  private static Parameter[] createParams(List<Map<String, Object>> params) {
    Parameter[] paramArray = new Parameter[params.size()];
    int index = 0;
    for ( Map<String, Object> entry : params ) {
      AnnotationDescriptor paramAnnotation = new AnnotationDescriptor( Parameter.class );
      paramAnnotation.setValue( "name", entry.get( "name" ) );
      paramAnnotation.setValue( "value", entry.get( "value" ) );
      paramArray[index] = AnnotationFactory.create( paramAnnotation );
      index++;
    }
    return paramArray;
  }
View Full Code Here

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


    private void createDateBridge(PropertyDescriptor property) {
      Map<String, Object> map = property.getDateBridge();
      for ( Map.Entry<String, Object> entry : map.entrySet() ) {
        AnnotationDescriptor dateBrigeAnnotation = new AnnotationDescriptor( DateBridge.class );
        dateBrigeAnnotation.setValue( entry.getKey(), entry.getValue() );
        annotations.put( DateBridge.class, AnnotationFactory.create( dateBrigeAnnotation ) );
      }
    }
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.