Package org.hibernate.metamodel.relational

Examples of org.hibernate.metamodel.relational.TableSpecification


    qualifiedTableNames = new String[joinSpan];
    isInverseTable = new boolean[joinSpan];
    isNullableTable = new boolean[joinSpan];
    keyColumnNames = new String[joinSpan][];

    final TableSpecification table = entityBinding.getPrimaryTable();
    qualifiedTableNames[0] = table.getQualifiedName( factory.getDialect() );
    isInverseTable[0] = false;
    isNullableTable[0] = false;
    keyColumnNames[0] = getIdentifierColumnNames();
    cascadeDeleteEnabled = new boolean[joinSpan];
View Full Code Here


  }

  private void bindTableUniqueConstraints(EntitySource entitySource, EntityBinding entityBinding) {
    for ( ConstraintSource constraintSource : entitySource.getConstraints() ) {
      if ( constraintSource instanceof UniqueConstraintSource ) {
        TableSpecification table = entityBinding.locateTable( constraintSource.getTableName() );
        if ( table == null ) {
          // throw exception !?
        }
        String constraintName = constraintSource.name();
        if ( constraintName == null ) {
          // create a default name
        }

        UniqueKey uniqueKey = table.getOrCreateUniqueKey( constraintName );
        for ( String columnName : constraintSource.columnNames() ) {
          uniqueKey.addColumn( table.locateOrCreateColumn( quoteIdentifier( columnName ) ) );
        }
      }
    }
  }
View Full Code Here

    List<SimpleValueBinding> valueBindings = new ArrayList<SimpleValueBinding>();

    if ( !relationalValueSourceContainer.relationalValueSources().isEmpty() ) {
      for ( RelationalValueSource valueSource : relationalValueSourceContainer.relationalValueSources() ) {
        final TableSpecification table = attributeBinding.getContainer()
            .seekEntityBinding()
            .locateTable( valueSource.getContainingTableName() );

        if ( ColumnSource.class.isInstance( valueSource ) ) {
          final ColumnSource columnSource = ColumnSource.class.cast( valueSource );
View Full Code Here

  }

  private SimpleValue makeSimpleValue(
      EntityBinding entityBinding,
      RelationalValueSource valueSource) {
    final TableSpecification table = entityBinding.locateTable( valueSource.getContainingTableName() );

    if ( ColumnSource.class.isInstance( valueSource ) ) {
      return makeColumn( (ColumnSource) valueSource, table );
    }
    else {
View Full Code Here

    qualifiedTableNames = new String[joinSpan];
    isInverseTable = new boolean[joinSpan];
    isNullableTable = new boolean[joinSpan];
    keyColumnNames = new String[joinSpan][];

    final TableSpecification table = entityBinding.getPrimaryTable();
    qualifiedTableNames[0] = table.getQualifiedName( factory.getDialect() );
    isInverseTable[0] = false;
    isNullableTable[0] = false;
    keyColumnNames[0] = getIdentifierColumnNames();
    cascadeDeleteEnabled = new boolean[joinSpan];
View Full Code Here

    public TableSpecification locateTable(String tableName) {
        if ( tableName == null || tableName.equals( getPrimaryTableName() ) ) {
            return primaryTable;
        }
        TableSpecification tableSpec = secondaryTables.get( tableName );
        if ( tableSpec == null ) {
            throw new AssertionFailure(
                    String.format(
                            "Unable to find table %s amongst tables %s",
                            tableName,
View Full Code Here

  public void prepareForeignKey(String foreignKeyName, String targetTableName) {
    if ( foreignKey != null ) {
      throw new AssertionFailure( "Foreign key already initialized" );
    }
    final TableSpecification collectionTable = pluralAttributeBinding.getCollectionTable();
    if ( collectionTable == null ) {
      throw new AssertionFailure( "Collection table not yet bound" );
    }

    final TableSpecification targetTable = pluralAttributeBinding.getContainer()
        .seekEntityBinding()
        .locateTable( targetTableName );

    // todo : handle implicit fk names...
View Full Code Here

    public TableSpecification locateTable(String tableName) {
        if ( tableName == null || tableName.equals( getPrimaryTableName() ) ) {
            return primaryTable;
        }
        TableSpecification tableSpec = secondaryTables.get( tableName );
        if ( tableSpec == null ) {
            throw new AssertionFailure(
                    String.format(
                            "Unable to find table %s amongst tables %s",
                            tableName,
View Full Code Here

    qualifiedTableNames = new String[joinSpan];
    isInverseTable = new boolean[joinSpan];
    isNullableTable = new boolean[joinSpan];
    keyColumnNames = new String[joinSpan][];

    final TableSpecification table = entityBinding.getPrimaryTable();
    qualifiedTableNames[0] = table.getQualifiedName( factory.getDialect() );
    isInverseTable[0] = false;
    isNullableTable[0] = false;
    keyColumnNames[0] = getIdentifierColumnNames();
    cascadeDeleteEnabled = new boolean[joinSpan];
View Full Code Here

    qualifiedTableNames = new String[joinSpan];
    isInverseTable = new boolean[joinSpan];
    isNullableTable = new boolean[joinSpan];
    keyColumnNames = new String[joinSpan][];

    final TableSpecification table = entityBinding.getPrimaryTable();
    qualifiedTableNames[0] = table.getQualifiedName( factory.getDialect() );
    isInverseTable[0] = false;
    isNullableTable[0] = false;
    keyColumnNames[0] = getIdentifierColumnNames();
    cascadeDeleteEnabled = new boolean[joinSpan];
View Full Code Here

TOP

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

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.