/** * Build a table definition object from a database table object */ protected TableDefinition getTableDefFromDBTable(DatabaseTable databaseTable) { TableDefinition tableDefinition = this.tableMap.get(databaseTable.getName()); if (tableDefinition == null) { //table not built yet, simply built it tableDefinition = new TableDefinition(); tableDefinition.setTable(databaseTable); tableDefinition.setName(databaseTable.getNameDelimited(databasePlatform)); tableDefinition.setQualifier(databaseTable.getTableQualifier()); if (databaseTable.hasUniqueConstraints()) { addUniqueKeyConstraints(tableDefinition, databaseTable.getUniqueConstraints()); } if (databaseTable.hasIndexes()) { tableDefinition.getIndexes().addAll(databaseTable.getIndexes()); } if (databaseTable.getCreationSuffix() !=null){ tableDefinition.setCreationSuffix(databaseTable.getCreationSuffix()); } // Add the foreign key constraints that were set on the table. if (databaseTable.hasForeignKeyConstraints()) { tableDefinition.setUserDefinedForeignKeyConstraints(databaseTable.getForeignKeyConstraints()); } tableMap.put(databaseTable.getName(), tableDefinition); } return tableDefinition; }
/** * Build a table definition object from a database table object */ protected TableDefinition getTableDefFromDBTable(DatabaseTable databaseTable) { TableDefinition tableDefinition = this.tableMap.get(databaseTable.getName()); if (tableDefinition == null) { //table not built yet, simply built it tableDefinition = new TableDefinition(); tableDefinition.setTable(databaseTable); tableDefinition.setName(databaseTable.getNameDelimited(databasePlatform)); tableDefinition.setQualifier(databaseTable.getTableQualifier()); if (databaseTable.hasUniqueConstraints()) { addUniqueKeyConstraints(tableDefinition, databaseTable.getUniqueConstraints()); } if (databaseTable.hasIndexes()) { tableDefinition.getIndexes().addAll(databaseTable.getIndexes()); } if (databaseTable.getCreationSuffix() !=null){ tableDefinition.setCreationSuffix(databaseTable.getCreationSuffix()); } // Add the foreign key constraints that were set on the table. if (databaseTable.hasForeignKeyConstraints()) { tableDefinition.setUserDefinedForeignKeyConstraints(databaseTable.getForeignKeyConstraints()); } tableMap.put(databaseTable.getName(), tableDefinition); } return tableDefinition; }
/** * INTERNAL: * Return a TableDefinition specifying sequence table. * Cache the table definition for re-use (during CREATE and DROP) */ public TableDefinition buildTableDefinition() { if (tableDefinition == null) { tableDefinition = new TableDefinition(); tableDefinition.setTable(getSequenceTable()); tableDefinition.setName(getSequenceTableName()); tableDefinition.setQualifier(getSequenceTableQualifier()); tableDefinition.addPrimaryKeyField(getSequenceNameFieldName(), String.class, 50); tableDefinition.addField(getSequenceCounterFieldName(), BigDecimal.class); tableDefinition.setIndexes(getSequenceTableIndexes()); } return tableDefinition; }
/** * INTERNAL: * Return a TableDefinition specifying sequence table. * Cache the table definition for re-use (during CREATE and DROP) */ public TableDefinition buildTableDefinition() { if (tableDefinition == null) { tableDefinition = new TableDefinition(); tableDefinition.setTable(getSequenceTable()); tableDefinition.setName(getSequenceTableName()); tableDefinition.setQualifier(getSequenceTableQualifier()); tableDefinition.addPrimaryKeyField(getSequenceNameFieldName(), String.class, 50); tableDefinition.addField(getSequenceCounterFieldName(), BigDecimal.class); tableDefinition.setIndexes(getSequenceTableIndexes()); } return tableDefinition; }