Package org.hibernate.annotations

Examples of org.hibernate.annotations.CollectionId


  ) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData( property, null, //default access should not be useful
              mappings.getReflectionManager() ),
          "id" );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isDefault( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here


  ) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData( null, property, null, //default access should not be useful
              mappings.getReflectionManager() ),
          "id" );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isDefault( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

      Mappings mappings) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData(
              null,
              property,
              null, //default access should not be useful
              mappings.getReflectionManager()
          ),
          "id"
      );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      //we need to make sure all id columns must be not-null.
      for(Ejb3Column idColumn:idColumns){
        idColumn.setNullable(false);
      }
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isDefault( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

      Mappings mappings) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData(
              null,
              property,
              null, //default access should not be useful
              mappings.getReflectionManager()
          ),
          "id"
      );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      //we need to make sure all id columns must be not-null.
      for(Ejb3Column idColumn:idColumns){
        idColumn.setNullable(false);
      }
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isEmptyAnnotationValue( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

      Mappings mappings) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData(
              null,
              property,
              null, //default access should not be useful
              mappings.getReflectionManager()
          ),
          "id"
      );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      //we need to make sure all id columns must be not-null.
      for(Ejb3Column idColumn:idColumns){
        idColumn.setNullable(false);
      }
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isEmptyAnnotationValue( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

      Mappings mappings) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData(
              null,
              property,
              null, //default access should not be useful
              mappings.getReflectionManager()
          ),
          "id"
      );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      //we need to make sure all id columns must be not-null.
      for(Ejb3Column idColumn:idColumns){
        idColumn.setNullable(false);
      }
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isEmptyAnnotationValue( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

  ) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData( null, property, null, //default access should not be useful
              mappings.getReflectionManager() ),
          "id" );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      //we need to make sure all id columns must be not-null.
      for(Ejb3Column idColumn:idColumns){
        idColumn.setNullable(false);
      }
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isDefault( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

  ) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData( property, null, //default access should not be useful
              mappings.getReflectionManager() ),
          "id" );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isDefault( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

  ) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if (collectionIdAnn != null) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData(property, null, //default access should not be useful
              mappings.getReflectionManager() ),
          "id" );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && ! BinderHelper.isDefault( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException("@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

  ) {
    boolean result = super.bindStarToManySecondPass(
        persistentClasses, collType, fkJoinColumns, keyColumns, inverseColumns, elementColumns, isEmbedded,
        property, unique, associationTableBinder, ignoreNotFound, mappings
    );
    CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class );
    if ( collectionIdAnn != null ) {
      SimpleValueBinder simpleValue = new SimpleValueBinder();

      PropertyData propertyData = new WrappedInferredData(
          new PropertyInferredData( null, property, null, //default access should not be useful
              mappings.getReflectionManager() ),
          "id" );
      Ejb3Column[] idColumns = Ejb3Column.buildColumnFromAnnotation(
          collectionIdAnn.columns(),
          null,
          Nullability.FORCED_NOT_NULL,
          propertyHolder,
          propertyData,
          Collections.EMPTY_MAP,
          mappings
      );
      //we need to make sure all id columns must be not-null.
      for(Ejb3Column idColumn:idColumns){
        idColumn.setNullable(false);
      }
      Table table = collection.getCollectionTable();
      simpleValue.setTable( table );
      simpleValue.setColumns( idColumns );
      Type typeAnn = collectionIdAnn.type();
      if ( typeAnn != null && !BinderHelper.isDefault( typeAnn.type() ) ) {
        simpleValue.setExplicitType( typeAnn );
      }
      else {
        throw new AnnotationException( "@CollectionId is missing type: "
            + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
      }
      simpleValue.setMappings( mappings );
      SimpleValue id = simpleValue.make();
      ( (IdentifierCollection) collection ).setIdentifier( id );
      String generator = collectionIdAnn.generator();
      String generatorType;
      if ( "identity".equals( generator ) || "assigned".equals( generator )
          || "sequence".equals( generator ) || "native".equals( generator ) ) {
        generatorType = generator;
        generator = "";
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.CollectionId

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.