public static String getAlterSQLForColumnDefault(TableColumnInfo from, TableColumnInfo to, HibernateDialect dialect, DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs) { String oldDefault = from.getDefaultValue(); String newDefault = to.getDefaultValue(); // empty string ('') seems to be represented as null in some drivers. // Not sure if this is the best thing to do here, but it fixes an issue // where SQL returns is set default to '', when it is already null. if (oldDefault == null) { oldDefault = ""; } if (newDefault == null) { newDefault = ""; } if (!oldDefault.equals(newDefault)) { if (!dialect.supportsAlterColumnDefault()) { throw new UnsupportedOperationException(dialect.getDisplayName() + " doesn't support column default value alterations"); } return dialect.getColumnDefaultAlterSQL(to, qualifier, prefs); } return null; } }
public void setExistingColumnInfo(TableColumnInfo info) { tableNameTextField.setText(info.getTableName()); columnNameTextField.setText(info.getColumnName()); String dataType = JDBCTypeMapper.getJdbcTypeName(info.getDataType()); typeList.setSelectedItem(dataType); nullableCheckBox.setSelected(info.isNullable().equals("YES")); if (JDBCTypeMapper.isNumberType(info.getDataType())) { precisionSpinner.setValue(Integer.valueOf(info.getColumnSize())); } else { lengthSpinner.setValue(Integer.valueOf(info.getColumnSize())); } commentTextArea.setText(info.getRemarks()); defaultTextField.setText(info.getDefaultValue()); }
public void setExistingColumnInfo(TableColumnInfo info) { tableNameTextField.setText(info.getTableName()); columnNameTextField.setText(info.getColumnName()); String dataType = JDBCTypeMapper.getJdbcTypeName(info.getDataType()); typeList.setSelectedItem(dataType); nullableCheckBox.setSelected(info.isNullable().equals("YES")); if (JDBCTypeMapper.isNumberType(info.getDataType())) { precisionSpinner.setValue(Integer.valueOf(info.getColumnSize())); } else { lengthSpinner.setValue(Integer.valueOf(info.getColumnSize())); } commentTextArea.setText(info.getRemarks()); defaultTextField.setText(info.getDefaultValue()); }
public void setColumn2(TableColumnInfo c2) { col2Type = c2.getDataType(); col2Length = c2.getColumnSize(); col2IsNullable = c2.isNullable().equalsIgnoreCase("NO") ? false : true; tableName = c2.getTableName(); columnName = c2.getColumnName(); col2remarks = c2.getRemarks(); col2default = c2.getDefaultValue(); }
_defaultvalue.setText(tci.getDefaultValue());
public void setColumn1(TableColumnInfo c1) { col1Type = c1.getDataType(); col1Length = c1.getColumnSize(); col1IsNullable = c1.isNullable().equalsIgnoreCase("NO") ? false : true; tableName = c1.getTableName(); columnName = c1.getColumnName(); col1remarks = c1.getRemarks(); col1default = c1.getDefaultValue(); }
String defValue = infos[idx].getDefaultValue();
String defValue = infos[idx].getDefaultValue();
mc.isNullAllowed(), mc.getRemarks(), mc.getDefaultValue(), mc.getOctetLength(), mc.getOrdinalPosition(),