Package org.hibernate.metamodel.relational

Examples of org.hibernate.metamodel.relational.Column


        explicitName == null ?
            state.getNamingStrategy().propertyToColumnName( getAttribute().getName() ) :
            state.getNamingStrategy().columnName( explicitName );
// todo : find out the purpose of these logical bindings
//      mappings.addColumnBinding( logicalColumnName, column, table );
    Column columnValue = table.createColumn( columnName );
    columnValue.getSize().initialize( state.getSize() );
    columnValue.setNullable( ! forceNonNullable() &&  state.isNullable() );
    columnValue.setUnique( ! forceUnique() && state.isUnique()  );
    columnValue.setCheckCondition( state.getCheckCondition() );
    columnValue.setDefaultValue( state.getDefault() );
    columnValue.setSqlType( state.getSqlType() );
    columnValue.setWriteFragment( state.getCustomWriteFragment() );
    columnValue.setReadFragment( state.getCustomReadFragment() );
    columnValue.setComment( state.getComment() );
    for ( String uniqueKey : state.getUniqueKeys() ) {
      table.getOrCreateUniqueKey( uniqueKey ).addColumn( columnValue );
    }
    for ( String index : state.getIndexes() ) {
      table.getOrCreateIndex( index ).addColumn( columnValue );
View Full Code Here


  public boolean isNullable() {
    for ( SimpleValue simpleValue : getValues() ) {
      if ( simpleValue instanceof DerivedValue ) {
        return true;
      }
      Column column = (Column) simpleValue;
      if ( column.isNullable() ) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  public boolean isNullable() {
    for ( SimpleValue simpleValue : getValues() ) {
      if ( simpleValue instanceof DerivedValue ) {
        return true;
      }
      Column column = (Column) simpleValue;
      if ( column.isNullable() ) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

//      mappings.addColumnBinding( logicalColumnName, column, table );

    if ( columnName == null ) {
      throw new IllegalArgumentException( "columnName must be non-null." );
    }
    Column value = table.createColumn( columnName );
    value.initialize( state, forceNonNullable, forceUnique );
    return value;
  }
View Full Code Here

      LOG.noColumnsSpecifiedForIndex( indexName, table.toLoggableString() );
      return;
    }
    org.hibernate.metamodel.relational.Index index = table.getOrCreateIndex( indexName );
    for ( String columnName : columnNames ) {
      Column column = findColumn( table, columnName );
      if ( column == null ) {
        throw new AnnotationException( "@Index references a unknown column: " + columnName );
      }
      index.addColumn( column );
    }
View Full Code Here

      index.addColumn( column );
    }
  }

  private static Column findColumn(Table table, String columnName) {
    Column column = null;
    for ( SimpleValue value : table.values() ) {
      if ( value instanceof Column && ( (Column) value ).getName().equals( columnName ) ) {
        column = (Column) value;
        break;
      }
View Full Code Here

TOP

Related Classes of org.hibernate.metamodel.relational.Column

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.