Package org.hibernate.reflection

Examples of org.hibernate.reflection.XClass


      for ( Ejb3Column col : columns ) {
        col.forceNotNull();
      }
    }

    final XClass returnedClass = inferredData.getClassOrElement();
    if ( !entityBinder.isIgnoreIdAnnotations() &&
        ( property.isAnnotationPresent( Id.class )
            || property.isAnnotationPresent( EmbeddedId.class ) ) ) {
      if ( isIdentifierMapper ) {
        throw new AnnotationException(
            "@IdClass class should not have @Id nor @EmbeddedId proeperties"
        );
      }
      log.debug( inferredData.getPropertyName() + " is an id" );
      //clone classGenerator and override with local values
      HashMap<String, IdGenerator> localGenerators = (HashMap<String, IdGenerator>) classGenerators.clone();
      localGenerators.putAll( buildLocalGenerators( property, mappings ) );

      //manage composite related metadata
      //guess if its a component and find id data access (property, field etc)
      final boolean isComponent = returnedClass.isAnnotationPresent( Embeddable.class )
          || property.isAnnotationPresent( EmbeddedId.class );
      boolean propertyAnnotated = entityBinder.isPropertyAnnotated( returnedClass );
      String propertyAccessor = entityBinder.getPropertyAccessor( returnedClass );
      //if ( isComponent && embeddableAnn != null && embeddableAnn.access() == AccessType.FIELD ) propertyAccess = false;

      GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
      String generatorType = generatedValue != null ? generatorType( generatedValue.strategy() ) : "assigned";
      String generator = generatedValue != null ? generatedValue.generator() : BinderHelper.ANNOTATION_STRING_DEFAULT;
      if ( isComponent ) generatorType = "assigned"; //a component must not have any generator
      Type typeAnn = property.getAnnotation( Type.class );
      bindId(
          generatorType,
          generator,
          inferredData,
          columns,
          propertyHolder,
          localGenerators,
          isComponent,
          propertyAnnotated,
          propertyAccessor, entityBinder,
          typeAnn,
          false,
          isIdentifierMapper, mappings
      );
      if ( log.isDebugEnabled() ) {
        log.debug(
            "Bind " + ( isComponent ? "@EmbeddedId" : "@Id" ) + " on " + inferredData.getPropertyName()
        );
      }
    }
    else if ( property.isAnnotationPresent( Version.class ) ) {
      if ( isIdentifierMapper ) {
        throw new AnnotationException(
            "@IdClass class should not have @Version property"
        );
      }
      if ( ! ( propertyHolder.getPersistentClass() instanceof RootClass ) ) {
        throw new AnnotationException(
            "Unable to define/override @Version on a subclass: "
                + propertyHolder.getEntityName()
        );
      }
      log.debug( inferredData.getPropertyName() + " is a version property" );
      RootClass rootClass = (RootClass) propertyHolder.getPersistentClass();
      boolean lazy = false;
      PropertyBinder propBinder = new PropertyBinder();
      propBinder.setName( inferredData.getPropertyName() );
      propBinder.setReturnedClassName( inferredData.getTypeName() );
      propBinder.setLazy( lazy );
      propBinder.setPropertyAccessorName( inferredData.getDefaultAccess() );
      propBinder.setColumns( columns );
      propBinder.setHolder( propertyHolder ); //PropertyHolderBuilder.buildPropertyHolder(rootClass)
      propBinder.setProperty( property );
      propBinder.setReturnedClass( inferredData.getPropertyClass() );

      propBinder.setMappings( mappings );
      Property prop = propBinder.bind();
      rootClass.setVersion( prop );
      SimpleValue simpleValue = (SimpleValue) prop.getValue();
      if ( !simpleValue.isTypeSpecified() ) simpleValue.setTypeName( "integer" );
      simpleValue.setNullValue( "undefined" );
      rootClass.setOptimisticLockMode( Versioning.OPTIMISTIC_LOCK_VERSION );
      log.debug(
          "Version name: " + rootClass.getVersion().getName() + ", unsavedValue: " + ( (SimpleValue) rootClass
              .getVersion()
              .getValue() ).getNullValue()
      );
    }
    else if ( property.isAnnotationPresent( ManyToOne.class ) ) {
      ManyToOne ann = property.getAnnotation( ManyToOne.class );

      //check validity
      if ( property.isAnnotationPresent( Column.class )
          || property.isAnnotationPresent( Columns.class ) ) {
        throw new AnnotationException( "@Column(s) not allowed on a @ManyToOne property: "
          + StringHelper.qualify( propertyHolder.getPath(), inferredData.getPropertyName() ) );
      }

      Cascade hibernateCascade = property.getAnnotation( Cascade.class );
      NotFound notFound = property.getAnnotation( NotFound.class );
      boolean ignoreNotFound = notFound != null && notFound.action().equals( NotFoundAction.IGNORE );
      OnDelete onDeleteAnn = property.getAnnotation( OnDelete.class );
      boolean onDeleteCascade = onDeleteAnn != null && OnDeleteAction.CASCADE.equals( onDeleteAnn.action() );
      JoinTable assocTable = property.getAnnotation( JoinTable.class );
      if ( assocTable != null ) {
        Join join = propertyHolder.addJoin( assocTable, false );
        for ( Ejb3JoinColumn joinColumn : joinColumns ) {
          joinColumn.setSecondaryTableName( join.getTable().getName() );
        }
      }
      bindManyToOne(
          getCascadeStrategy( ann.cascade(), hibernateCascade ),
          joinColumns,
          ann.optional(),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
          propertyHolder,
          inferredData, false, isIdentifierMapper, inSecondPass, mappings
      );
    }
    else if ( property.isAnnotationPresent( OneToOne.class ) ) {
      OneToOne ann = property.getAnnotation( OneToOne.class );

      //check validity
      if ( property.isAnnotationPresent( Column.class )
          || property.isAnnotationPresent( Columns.class ) ) {
        throw new AnnotationException( "@Column(s) not allowed on a @OneToOne property: "
          + StringHelper.qualify( propertyHolder.getPath(), inferredData.getPropertyName() ) );
      }

      //FIXME support a proper PKJCs
      boolean trueOneToOne = property.isAnnotationPresent( PrimaryKeyJoinColumn.class )
          || property.isAnnotationPresent( PrimaryKeyJoinColumns.class );
      Cascade hibernateCascade = property.getAnnotation( Cascade.class );
      NotFound notFound = property.getAnnotation( NotFound.class );
      boolean ignoreNotFound = notFound != null && notFound.action().equals( NotFoundAction.IGNORE );
      OnDelete onDeleteAnn = property.getAnnotation( OnDelete.class );
      boolean onDeleteCascade = onDeleteAnn != null && OnDeleteAction.CASCADE.equals( onDeleteAnn.action() );
      JoinTable assocTable = property.getAnnotation( JoinTable.class );
      if ( assocTable != null ) {
        Join join = propertyHolder.addJoin( assocTable, false );
        for ( Ejb3JoinColumn joinColumn : joinColumns ) {
          joinColumn.setSecondaryTableName( join.getTable().getName() );
        }
      }
      bindOneToOne(
          getCascadeStrategy( ann.cascade(), hibernateCascade ),
          joinColumns,
          ann.optional(),
          getFetchMode( ann.fetch() ),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
          propertyHolder,
          inferredData, ann.mappedBy(), trueOneToOne, isIdentifierMapper, inSecondPass, mappings
      );
    }
    else if ( property.isAnnotationPresent( OneToMany.class )
        || property.isAnnotationPresent( ManyToMany.class )
        || property.isAnnotationPresent( CollectionOfElements.class ) ) {
      OneToMany oneToManyAnn = property.getAnnotation( OneToMany.class );
      ManyToMany manyToManyAnn = property.getAnnotation( ManyToMany.class );
      CollectionOfElements collectionOfElementsAnn = property.getAnnotation( CollectionOfElements.class );
      org.hibernate.annotations.IndexColumn indexAnn = property.getAnnotation(
          org.hibernate.annotations.IndexColumn.class
      );
      JoinTable assocTable = property.getAnnotation( JoinTable.class );

      IndexColumn indexColumn = IndexColumn.buildColumnFromAnnotation(
          indexAnn, propertyHolder, inferredData, mappings
      );
      CollectionBinder collectionBinder = CollectionBinder.getCollectionBinder(
          propertyHolder.getEntityName(),
          property,
          ! indexColumn.isImplicit()
      );
      collectionBinder.setIndexColumn( indexColumn );
      MapKey mapKeyAnn = property.getAnnotation( MapKey.class );
      collectionBinder.setMapKey( mapKeyAnn );
      collectionBinder.setPropertyName( inferredData.getPropertyName() );
      BatchSize batchAnn = property.getAnnotation( BatchSize.class );
      collectionBinder.setBatchSize( batchAnn );
      javax.persistence.OrderBy ejb3OrderByAnn = property.getAnnotation( javax.persistence.OrderBy.class );
      OrderBy orderByAnn = property.getAnnotation( OrderBy.class );
      collectionBinder.setEjb3OrderBy( ejb3OrderByAnn );
      collectionBinder.setSqlOrderBy( orderByAnn );
      Sort sortAnn = property.getAnnotation( Sort.class );
      collectionBinder.setSort( sortAnn );
      Cache cachAnn = property.getAnnotation( Cache.class );
      collectionBinder.setCache( cachAnn );
      collectionBinder.setPropertyHolder( propertyHolder );
      Cascade hibernateCascade = property.getAnnotation( Cascade.class );
      NotFound notFound = property.getAnnotation( NotFound.class );
      boolean ignoreNotFound = notFound != null && notFound.action().equals( NotFoundAction.IGNORE );
      collectionBinder.setIgnoreNotFound( ignoreNotFound );
      collectionBinder.setCollectionType( inferredData.getProperty().getElementClass() );
      collectionBinder.setMappings( mappings );
      collectionBinder.setPropertyAccessorName( inferredData.getDefaultAccess() );

      Ejb3Column[] elementColumns = null;
      PropertyData virtualProperty = new WrappedInferredData( inferredData, "element" );
      if ( property.isAnnotationPresent( Column.class ) || property.isAnnotationPresent(
          Formula.class
      ) ) {
        Column ann = property.getAnnotation( Column.class );
        Formula formulaAnn = property.getAnnotation( Formula.class );
        elementColumns = Ejb3Column.buildColumnFromAnnotation(
            new Column[]{ann},
            formulaAnn,
            nullability,
            propertyHolder,
            virtualProperty,
            entityBinder.getSecondaryTables(),
            mappings
        );
      }
      else if ( property.isAnnotationPresent( Columns.class ) ) {
        Columns anns = property.getAnnotation( Columns.class );
        elementColumns = Ejb3Column.buildColumnFromAnnotation(
            anns.columns(), null, nullability, propertyHolder, virtualProperty,
            entityBinder.getSecondaryTables(), mappings
        );
      }
      else {
        elementColumns = Ejb3Column.buildColumnFromAnnotation(
            null,
            null,
            nullability,
            propertyHolder,
            virtualProperty,
            entityBinder.getSecondaryTables(),
            mappings
        );
      }

      org.hibernate.annotations.MapKey hibMapKeyAnn = property.getAnnotation(
          org.hibernate.annotations.MapKey.class
      );
      PropertyData mapKeyVirtualProperty = new WrappedInferredData( inferredData, "mapkey" );
      Ejb3Column[] mapColumns = Ejb3Column.buildColumnFromAnnotation(
          hibMapKeyAnn != null && hibMapKeyAnn.columns().length > 0 ? hibMapKeyAnn.columns() : null,
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          mapKeyVirtualProperty,
          entityBinder.getSecondaryTables(),
          mappings
      );
      collectionBinder.setMapKeyColumns( mapColumns );

      MapKeyManyToMany mapKeyManyToMany = property.getAnnotation( MapKeyManyToMany.class );
      Ejb3JoinColumn[] mapJoinColumns = Ejb3JoinColumn.buildJoinColumns(
          mapKeyManyToMany != null ? mapKeyManyToMany.joinColumns() : null,
          null, entityBinder.getSecondaryTables(),
          propertyHolder, mapKeyVirtualProperty.getPropertyName(), mappings
      );
      collectionBinder.setMapKeyManyToManyColumns( mapJoinColumns );

      //potential element
      collectionBinder.setEmbedded( property.isAnnotationPresent( Embedded.class ) );
      collectionBinder.setElementColumns( elementColumns );
      collectionBinder.setProperty( property );

      if ( oneToManyAnn != null && manyToManyAnn != null ) {
        throw new AnnotationException(
            "@OneToMany and @ManyToMany on the same property is not allowed: "
                + propertyHolder.getEntityName() + "." + inferredData.getPropertyName()
        );
      }
      String mappedBy = null;
      if ( oneToManyAnn != null ) {
        for ( Ejb3JoinColumn column : joinColumns ) {
          if ( column.isSecondary() ) {
            throw new NotYetImplementedException( "Collections having FK in secondary table" );
          }
        }
        collectionBinder.setFkJoinColumns( joinColumns );
        mappedBy = oneToManyAnn.mappedBy();
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
        );
        collectionBinder.setCascadeStrategy( getCascadeStrategy( oneToManyAnn.cascade(), hibernateCascade ) );
        collectionBinder.setOneToMany( true );
      }
      else if ( collectionOfElementsAnn != null ) {
        for ( Ejb3JoinColumn column : joinColumns ) {
          if ( column.isSecondary() ) {
            throw new NotYetImplementedException( "Collections having FK in secondary table" );
          }
        }
        collectionBinder.setFkJoinColumns( joinColumns );
        mappedBy = "";
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( collectionOfElementsAnn.targetElement() )
        );
        //collectionBinder.setCascadeStrategy( getCascadeStrategy( embeddedCollectionAnn.cascade(), hibernateCascade ) );
        collectionBinder.setOneToMany( true );
      }
      else if ( manyToManyAnn != null ) {
        mappedBy = manyToManyAnn.mappedBy();
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
        );
        collectionBinder.setCascadeStrategy( getCascadeStrategy( manyToManyAnn.cascade(), hibernateCascade ) );
        collectionBinder.setOneToMany( false );
      }
      collectionBinder.setMappedBy( mappedBy );
      bindJoinedTableAssociation(
          assocTable, mappings, entityBinder, collectionBinder, propertyHolder, inferredData, mappedBy
      );

      OnDelete onDeleteAnn = property.getAnnotation( OnDelete.class );
      boolean onDeleteCascade = onDeleteAnn != null && OnDeleteAction.CASCADE.equals( onDeleteAnn.action() );
      collectionBinder.setCascadeDeleteEnabled( onDeleteCascade );
      if ( isIdentifierMapper ) {
        collectionBinder.setInsertable( false );
        collectionBinder.setUpdatable( false );
      }
      if ( property.isAnnotationPresent( CollectionId.class ) ) { //do not compute the generators unless necessary
        HashMap<String, IdGenerator> localGenerators = (HashMap<String, IdGenerator>) classGenerators.clone();
        localGenerators.putAll( buildLocalGenerators( property, mappings ) );
        collectionBinder.setLocalGenerators(localGenerators);

      }
      collectionBinder.bind();

    }
    else {
      //define whether the type is a component or not
      boolean isComponent = false;
      Embeddable embeddableAnn = (Embeddable) returnedClass.getAnnotation( Embeddable.class );
      Embedded embeddedAnn = (Embedded) property.getAnnotation( Embedded.class );
      isComponent = embeddedAnn != null || embeddableAnn != null;

      if ( isComponent ) {
        //process component object
View Full Code Here


    PropertyHolder subHolder = PropertyHolderBuilder.buildPropertyHolder(
        comp, subpath,
        inferredData, propertyHolder, mappings
    );
    List<PropertyData> classElements = new ArrayList<PropertyData>();
    XClass returnedClassOrElement = inferredData.getClassOrElement();
    addElementsOfAClass(
        classElements,
        subHolder,
        propertyAnnotated,
        propertyAccessor, returnedClassOrElement, mappings
    );
    //add elements of the embeddable superclass
    XClass superClass = inferredData.getPropertyClass().getSuperclass();
    while ( superClass != null && superClass.isAnnotationPresent( MappedSuperclass.class ) ) {
      //FIXME: proper support of typevariables incl var resolved at upper levels
      addElementsOfAClass(
          classElements,
          subHolder,
          entityBinder.isPropertyAnnotated( superClass ),
          propertyAccessor, superClass, mappings
      );
      superClass = superClass.getSuperclass();
    }
    for ( PropertyData propertyAnnotatedElement : classElements ) {
      processElementAnnotations(
          subHolder, isNullable ? Nullability.NO_CONSTRAINT : Nullability.FORCED_NOT_NULL,
          propertyAnnotatedElement.getProperty(), propertyAnnotatedElement,
View Full Code Here

        element.setFetchMode( FetchMode.JOIN );
        element.setLazy( false );
        //does not make sense for a map key element.setIgnoreNotFound( ignoreNotFound );
      }
      else {
        XClass elementClass;
        AnnotatedClassType classType;
        //      Map<String, javax.persistence.Column[]> columnOverrides = PropertyHolderBuilder.buildColumnOverride(
        //          property, StringHelper.qualify( collValue.getRole(), "element" )
        //      );
        //FIXME the "element" is lost
View Full Code Here

    }
    return override;
  }

  private void buildHierarchyColumnOverride(XClass element) {
    XClass current = element;
    Map<String, Column[]> columnOverride = new HashMap<String, Column[]>();
    Map<String, JoinColumn[]> joinColumnOverride = new HashMap<String, JoinColumn[]>();
    while ( current != null && ! mappings.getReflectionManager().toXClass( Object.class ).equals( current ) ) {
      if ( current.isAnnotationPresent( Entity.class ) || current.isAnnotationPresent( MappedSuperclass.class )
          || current.isAnnotationPresent( Embeddable.class ) ) {
        //FIXME is embeddable override?
        Map<String, Column[]> currentOverride = buildColumnOverride( current, getPath() );
        Map<String, JoinColumn[]> currentJoinOverride = buildJoinColumnOverride( current, getPath() );
        currentOverride.putAll( columnOverride ); //subclasses have precedence over superclasses
        currentJoinOverride.putAll( joinColumnOverride ); //subclasses have precedence over superclasses
        columnOverride = currentOverride;
        joinColumnOverride = currentJoinOverride;
      }
      current = current.getSuperclass();
    }

    holderColumnOverride = columnOverride.size() > 0 ? columnOverride : null;
    holderJoinColumnOverride = joinColumnOverride.size() > 0 ? joinColumnOverride : null;
  }
View Full Code Here

  protected List<XClass> orderAndFillHierarchy(List<XClass> original) {
    //TODO remove embeddable
    List<XClass> copy = new ArrayList<XClass>( original );
    //for each class, copy all the relevent hierarchy
    for ( XClass clazz : original ) {
      XClass superClass = clazz.getSuperclass();
      while ( ! reflectionManager.equals( superClass, Object.class ) && ! copy.contains( superClass ) ) {
        if ( superClass.isAnnotationPresent( Entity.class )
            || superClass.isAnnotationPresent( MappedSuperclass.class ) ) {
          copy.add( superClass );
        }
        superClass = superClass.getSuperclass();
      }
    }
    List<XClass> workingCopy = new ArrayList<XClass>( copy );
    List<XClass> newList = new ArrayList<XClass>( copy.size() );
    while ( workingCopy.size() > 0 ) {
      XClass clazz = workingCopy.get( 0 );
      orderHierarchy( workingCopy, newList, copy, clazz );
    }
    return newList;
  }
View Full Code Here

   *
   * @param persistentClass the mapped class
   * @return the configuration object
   */
  public AnnotationConfiguration addAnnotatedClass(Class persistentClass) throws MappingException {
    XClass persistentXClass = reflectionManager.toXClass( persistentClass );
    try {
      annotatedClasses.add( persistentXClass );
      return this;
    }
    catch (MappingException me) {
View Full Code Here

  public static InheritanceState getSuperEntityInheritanceState(
      XClass clazz, Map<XClass, InheritanceState> states,
      ReflectionManager reflectionManager
  ) {
    XClass superclass = clazz;
    do {
      superclass = superclass.getSuperclass();
      InheritanceState currentState = states.get( superclass );
      if ( currentState != null && ! currentState.isEmbeddableSuperclass ) return currentState;
    }
    while ( ! reflectionManager.equals( superclass, Object.class ) );
    return null;
View Full Code Here

  public static InheritanceState getSuperclassInheritanceState(
      XClass clazz, Map<XClass, InheritanceState> states,
      ReflectionManager reflectionManager
  ) {
    XClass superclass = clazz;
    do {
      superclass = superclass.getSuperclass();
      InheritanceState currentState = states.get( superclass );
      if ( currentState != null ) return currentState;
    }
    while ( ! reflectionManager.equals( superclass, Object.class ) );
    return null;
View Full Code Here

  }

  //TODO execute it lazily to be order safe
  public void setType(XProperty property, XClass returnedClass) {
    if ( returnedClass == null ) return; //we cannot guess anything
    XClass returnedClassOrElement = returnedClass;
    boolean isArray = false;
    if ( property.isArray() ) {
      returnedClassOrElement = property.getElementClass();
      isArray = true;
    }
    Properties typeParameters = this.typeParameters;
    typeParameters.clear();
    String type = BinderHelper.ANNOTATION_STRING_DEFAULT;
    if ( property.isAnnotationPresent( Temporal.class ) ) {
      Temporal ann = property.getAnnotation( Temporal.class );
      boolean isDate;
      if ( mappings.getReflectionManager().equals( returnedClassOrElement, Date.class ) ) {
        isDate = true;
      }
      else if ( mappings.getReflectionManager().equals( returnedClassOrElement, Calendar.class ) ) {
        isDate = false;
      }
      else {
        throw new AnnotationException(
            "@Temporal should be set on a java.util.Date or java.util.Calendar property: "
                + StringHelper.qualify( persistentClassName, propertyName )
        );
      }

      switch ( ann.value() ) {
        case DATE:
          type = isDate ? "date" : "calendar_date";
          break;
        case TIME:
          type = "time";
          if ( ! isDate ) {
            throw new NotYetImplementedException(
                "Calendar cannot persist TIME only"
                    + StringHelper.qualify( persistentClassName, propertyName )
            );
          }
          break;
        case TIMESTAMP:
          type = isDate ? "timestamp" : "calendar";
          break;
        default:
          throw new AssertionFailure( "Unknown temporal type: " + ann.value() );
      }
    }
    else if ( property.isAnnotationPresent( Lob.class ) ) {

      if ( mappings.getReflectionManager().equals( returnedClassOrElement, java.sql.Clob.class ) ) {
        type = "clob";
      }
      else if ( mappings.getReflectionManager().equals( returnedClassOrElement, java.sql.Blob.class ) ) {
        type = "blob";
      }
      else if ( mappings.getReflectionManager().equals( returnedClassOrElement, String.class ) ) {
        type = StringClobType.class.getName();
      }
      else if ( mappings.getReflectionManager().equals( returnedClassOrElement, Character.class ) && isArray ) {
        type = CharacterArrayClobType.class.getName();
      }
      else if ( mappings.getReflectionManager().equals( returnedClassOrElement, char.class ) && isArray ) {
        type = PrimitiveCharacterArrayClobType.class.getName();
      }
      else if ( mappings.getReflectionManager().equals( returnedClassOrElement, Byte.class ) && isArray ) {
        type = ByteArrayBlobType.class.getName();
      }
      else if ( mappings.getReflectionManager().equals( returnedClassOrElement, byte.class ) && isArray ) {
        type = PrimitiveByteArrayBlobType.class.getName();
      }
      else if ( mappings.getReflectionManager()
          .toXClass( Serializable.class )
          .isAssignableFrom( returnedClassOrElement ) ) {
        type = SerializableToBlobType.class.getName();
        //typeParameters = new Properties();
        typeParameters.setProperty(
            SerializableToBlobType.CLASS_NAME,
            returnedClassOrElement.getName()
        );
      }
      else {
        type = "blob";
      }
    }
    //implicit type will check basic types and Serializable classes
    if ( columns == null ) {
      throw new AssertionFailure( "SimpleValueBinder.setColumns should be set before SimpleValueBinder.setType" );
    }
    if ( BinderHelper.ANNOTATION_STRING_DEFAULT.equals( type ) ) {
      if ( returnedClassOrElement.isEnum() ) {
        type = EnumType.class.getName();
        typeParameters = new Properties();
        typeParameters.setProperty( EnumType.ENUM, returnedClassOrElement.getName() );
        String schema = columns[0].getTable().getSchema();
        schema = schema == null ? "" : schema;
        String catalog = columns[0].getTable().getCatalog();
        catalog = catalog == null ? "" : catalog;
        typeParameters.setProperty( EnumType.SCHEMA, schema );
View Full Code Here

        mapKeyColumns, mapKeyManyToManyColumns, isEmbedded,
        property, collType,
        ignoreNotFound, oneToMany,
        tableBinder, mappings
    );
    XClass collectionType = getCollectionType();
    if ( collectionType.isAnnotationPresent( Embeddable.class )
        || property.isAnnotationPresent( CollectionOfElements.class ) ) {
      // do it right away, otherwise @ManyToon on composite element call addSecondPass
      // and raise a ConcurrentModificationException
      //sp.doSecondPass( CollectionHelper.EMPTY_MAP );
      mappings.addSecondPass( sp, ! isMappedBy );
View Full Code Here

TOP

Related Classes of org.hibernate.reflection.XClass

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.