Package org.hibernate.metamodel.relational

Examples of org.hibernate.metamodel.relational.Table


    final String tableName = attributeSource.getExplicitCollectionTableName();
    if ( StringHelper.isNotEmpty( tableName ) ) {
      final Identifier tableIdentifier = Identifier.toIdentifier(
          currentBindingContext.getNamingStrategy().tableName( tableName )
      );
      Table collectionTable = schema.locateTable( tableIdentifier );
      if ( collectionTable == null ) {
        collectionTable = schema.createTable( tableIdentifier );
      }
      pluralAttributeBinding.setCollectionTable( collectionTable );
    }
View Full Code Here


  // Relational ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  private void bindPrimaryTable(EntitySource entitySource, EntityBinding entityBinding) {
    final TableSource tableSource = entitySource.getPrimaryTable();
    final Table table = createTable( entityBinding, tableSource );
    entityBinding.setPrimaryTable( table );
    entityBinding.setPrimaryTableName( table.getTableName().getName() );
  }
View Full Code Here

    entityBinding.setPrimaryTableName( table.getTableName().getName() );
  }

  private void bindSecondaryTables(EntitySource entitySource, EntityBinding entityBinding) {
    for ( TableSource secondaryTableSource : entitySource.getSecondaryTables() ) {
      final Table table = createTable( entityBinding, secondaryTableSource );
      entityBinding.addSecondaryTable( secondaryTableSource.getLogicalName(), table );
    }
  }
View Full Code Here

  private static void bind(MetadataImplementor metadata, AnnotationInstance tableAnnotation) {
    String tableName = JandexHelper.getValue( tableAnnotation, "appliesTo", String.class );
    ObjectName objectName = new ObjectName( tableName );
    Schema schema = metadata.getDatabase().getSchema( objectName.getSchema(), objectName.getCatalog() );
    Table table = schema.locateTable( objectName.getName() );
    if ( table != null ) {
      bindHibernateTableAnnotation( table, tableAnnotation );
    }
  }
View Full Code Here

  private static void bind(MetadataImplementor metadata, AnnotationInstance tableAnnotation) {
    String tableName = JandexHelper.getValue( tableAnnotation, "appliesTo", String.class );
    ObjectName objectName = new ObjectName( tableName );
    Schema schema = metadata.getDatabase().getSchema( objectName.getSchema(), objectName.getCatalog() );
    Table table = schema.locateTable( objectName.getName() );
    if ( table != null ) {
      bindHibernateTableAnnotation( table, tableAnnotation );
    }
  }
View Full Code Here

            catalogName = StringHelper.quote( catalogName );
            tableName = StringHelper.quote( tableName );
        }
        final Identifier tableNameIdentifier = Identifier.toIdentifier( tableName );
        final Schema schema = meta.getDatabase().getSchema( new Schema.Name( schmaName, catalogName ) );
        Table table = schema.getTable( tableNameIdentifier );
        if ( table == null ) {
            table = schema.createTable( tableNameIdentifier );
        }
        return table;
    }
View Full Code Here

        return table;
    }


  private void bindTable(EntityBinding entityBinding) {
        Table table = createTable();
    entityBinding.setBaseTable( table );

    AnnotationInstance checkAnnotation = JandexHelper.getSingleAnnotation(
        entityClass.getClassInfo(), HibernateDotNames.CHECK
    );
    if ( checkAnnotation != null ) {
      table.addCheckConstraint( checkAnnotation.value( "constraints" ).asString() );
    }
  }
View Full Code Here

  private static void bind(MetadataImplementor metadata, AnnotationInstance tableAnnotation) {
    String tableName = JandexHelper.getValueAsString( tableAnnotation, "appliesTo" );
    ObjectName objectName = new ObjectName( tableName );
    Schema schema = metadata.getDatabase().getSchema( objectName.getSchema(), objectName.getCatalog() );
    Table table = schema.getTable( objectName.getName() );
    if ( table != null ) {
      bindHibernateTableAnnotation( table, tableAnnotation );
    }
  }
View Full Code Here

    final String tableName = attributeSource.getExplicitCollectionTableName();
    if ( StringHelper.isNotEmpty( tableName ) ) {
      final Identifier tableIdentifier = Identifier.toIdentifier(
          currentBindingContext.getNamingStrategy().tableName( tableName )
      );
      Table collectionTable = schema.locateTable( tableIdentifier );
      if ( collectionTable == null ) {
        collectionTable = schema.createTable( tableIdentifier );
      }
      pluralAttributeBinding.setCollectionTable( collectionTable );
    }
View Full Code Here

  // Relational ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  private void bindPrimaryTable(EntitySource entitySource, EntityBinding entityBinding) {
    final TableSource tableSource = entitySource.getPrimaryTable();
    final Table table = createTable( entityBinding, tableSource );
    entityBinding.setPrimaryTable( table );
    entityBinding.setPrimaryTableName( table.getTableName().getName() );
  }
View Full Code Here

TOP

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

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.