protected String determineTableName(Table table, JdbcEnvironment jdbcEnvironment) { if ( table.getSubselect() != null ) { return "( " + table.getSubselect() + " )"; } return jdbcEnvironment.getQualifiedObjectNameFormatter().format( table.getQualifiedTableName(), jdbcEnvironment.getDialect() ); }
protected String determineTableName(Table table, JdbcEnvironment jdbcEnvironment) { if ( table.getSubselect() != null ) { return "( " + table.getSubselect() + " )"; } return jdbcEnvironment.getQualifiedObjectNameFormatter().format( table.getQualifiedTableName(), jdbcEnvironment.getDialect() ); }
if ( secondaryTable.getSubselect() == null ) { secondaryTableJoin.createPrimaryKey(); secondaryTableJoin.createForeignKey();
public SimpleDatabase(Iterator<Table> iter, Dialect dialect, TableNameFormatter formatter, Mapping mapping) { Map<String, Table> map = new HashMap<String, Table>(); while (iter.hasNext()) { Table t = iter.next(); map.put(formatter.getQualifiedTableName(dialect, t), t); if (t.getSubselect() != null) { map.put("( " + t.getSubselect() + " )", t); } Iterator<Column> columnIter = t.getColumnIterator(); while (columnIter.hasNext()) { final Column column = columnIter.next(); column.getSqlType(dialect, mapping); } } this.tables = Collections.unmodifiableMap(map); }
@Override public InflightTable generateRuntimeTable( PhysicalNamingStrategy namingStrategy, JdbcEnvironment jdbcEnvironment, IdentifierGeneratorFactory identifierGeneratorFactory, RuntimeDatabaseModelProducer.Callback callback, TypeConfiguration typeConfiguration) { InflightTable runtimeTable; if ( getSubselect() != null ) { runtimeTable = new DerivedTable( getUid(), getSubselect(), isAbstract() ); } else { runtimeTable = createRuntimePhysicalTable( namingStrategy, jdbcEnvironment, identifierGeneratorFactory, typeConfiguration ); } addColumnsToInflightTable( runtimeTable, namingStrategy, jdbcEnvironment, callback, typeConfiguration ); callback.tableBuilt( this, runtimeTable ); return runtimeTable; }