/** * Treat tables with no primary keys as a table with all primary keys. */ private static void makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound(Table table) { if ((table != null) && (table.getPrimaryKeyColumns() != null) && (table.getPrimaryKeyColumns().length == 0)) { Column[] allCoumns = table.getColumns(); for (Column column : allCoumns) { column.setPrimaryKey(true); } } }
for (Column tableColumn : table.getColumns()) { isRequiredMap.put(StringUtils.lowerCase(tableColumn.getName()), tableColumn.isRequired()); for (Column tableColumn : table.getColumns()) { isRequiredMap.put(StringUtils.lowerCase(tableColumn.getName()), tableColumn.isRequired());
/** * oracle的erosa获取的字段类型,没有转换成jdbc的类型,所以需要手工转一下. */ private int[] getOraclePkTypes(Table table, String[] pkNames) { Column[] columns = table.getColumns(); List<Integer> pkTypes = new ArrayList<Integer>(); for (String pkName : pkNames) { for (Column column : columns) { if (column.getName().equalsIgnoreCase(pkName)) { pkTypes.add(column.getTypeCode()); } } } int[] types = new int[pkTypes.size()]; for (int i = 0; i < types.length; i++) { types[i] = pkTypes.get(i); } return types; }
/** * Helper method that determines the auto increment status using Firebird's system tables. * * @param table The table */ protected void determineAutoIncrementColumns(Table table) throws SQLException { Column[] columns = table.getColumns(); for (int idx = 0; idx < columns.length; idx++) { columns[idx].setAutoIncrement(isAutoIncrement(table, columns[idx])); } }
/** * {@inheritDoc} */ protected Table readTable(DatabaseMetaDataWrapper metaData, Map values) throws SQLException { Table table = super.readTable(metaData, values); if (table != null) { // Sybase does not return the auto-increment status via the database metadata determineAutoIncrementFromResultSetMetaData(table, table.getColumns()); } return table; }
/** * Treat tables with no primary keys as a table with all primary keys. */ private static void makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound(Table table) { if ((table != null) && (table.getPrimaryKeyColumns() != null) && (table.getPrimaryKeyColumns().length == 0)) { Column[] allCoumns = table.getColumns(); for (Column column : allCoumns) { column.setPrimaryKey(true); } } }
/** * Treat tables with no primary keys as a table with all primary keys. */ private static void makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound(Table table) { if ((table != null) && (table.getPrimaryKeyColumns() != null) && (table.getPrimaryKeyColumns().length == 0)) { Column[] allCoumns = table.getColumns(); for (Column column : allCoumns) { column.setPrimaryKey(true); } } }
Column[] columns = table.getColumns(); HashMap names = new HashMap(); String name;
Column[] columns = table.getColumns(); HashMap names = new HashMap(); String name;
Column[] columns = intermediateTable.getColumns();
Column[] tableColumns = table.getColumns();
Column[] tableColumns = table.getColumns(); List<Column> noPkcolumns = new ArrayList<Column>(); for (Column tableColumn : tableColumns) {
determineAutoIncrementFromResultSetMetaData(table, table.getColumns());
Map<String, Boolean> isRequiredMap = new HashMap<>(); Table table = dbDialect.findTable(record.getSchemaName(), record.getTableName()); for (Column tableColumn : table.getColumns()) { isRequiredMap.put(StringUtils.lowerCase(tableColumn.getName()), tableColumn.isRequired());
return list; Column[] columns = table.getColumns(); for(Column c : columns) { ColumnMeta cm = new ColumnMeta();
String tableName = t.getName(); String type = t.getType(); Column[] columns = t.getColumns(); List<ColumnMeta> cols = new ArrayList<>(); for(Column c : columns) {
for (Column tableColumn : table.getColumns()) { isRequiredMap.put(StringUtils.lowerCase(tableColumn.getName()), tableColumn.isRequired()); for (Column tableColumn : table.getColumns()) { isRequiredMap.put(StringUtils.lowerCase(tableColumn.getName()), tableColumn.isRequired());
int srcType = column.getColumnType(); for (Column c : table.getColumns()) { if (c.getName().equalsIgnoreCase(columnName)) { column.setColumnType(c.getTypeCode());
/** * Adjusts the columns in the table by fixing types and default values. * * @param table The table */ protected void adjustColumns(Table table) { Column[] columns = table.getColumns(); for (int idx = 0; idx < columns.length; idx++) { if (columns[idx].getTypeCode() == Types.FLOAT) { columns[idx].setTypeCode(Types.REAL); } else if ((columns[idx].getTypeCode() == Types.NUMERIC) || (columns[idx].getTypeCode() == Types.DECIMAL)) { if ((columns[idx].getTypeCode() == Types.NUMERIC) && (columns[idx].getSizeAsInt() == 18) && (columns[idx].getScale() == 0)) { columns[idx].setTypeCode(Types.BIGINT); } } else if (TypeMap.isTextType(columns[idx].getTypeCode())) { columns[idx].setDefaultValue(unescape(columns[idx].getDefaultValue(), "'", "''")); } } }
Column matchDbColumn = getMatchColumn(tableHolder.getTable().getColumns(), tcolumn.getColumnName()); matchDbColumn = getMatchColumn(tableHolder.getTable().getColumns(), tcolumn.getColumnName()); if (matchDbColumn == null) { if (canColumnsNotExist) {