Skip to content

Commit

Permalink
null check on post process of table in platform
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Oct 31, 2011
1 parent c718c98 commit b23c8c1
Showing 1 changed file with 13 additions and 14 deletions.
Expand Up @@ -944,20 +944,19 @@ protected void postprocessModelFromDatabase(Database model)
}

protected Table postprocessTableFromDatabase(Table table) {
for (int columnIdx = 0; columnIdx < table.getColumnCount(); columnIdx++)
{
Column column = table.getColumn(columnIdx);

if (TypeMap.isTextType(column.getTypeCode()) ||
TypeMap.isDateTimeType(column.getTypeCode()))
{
String defaultValue = column.getDefaultValue();

if ((defaultValue != null) && (defaultValue.length() >= 2) &&
defaultValue.startsWith("'") && defaultValue.endsWith("'"))
{
defaultValue = defaultValue.substring(1, defaultValue.length() - 1);
column.setDefaultValue(defaultValue);
if (table != null) {
for (int columnIdx = 0; columnIdx < table.getColumnCount(); columnIdx++) {
Column column = table.getColumn(columnIdx);

if (TypeMap.isTextType(column.getTypeCode())
|| TypeMap.isDateTimeType(column.getTypeCode())) {
String defaultValue = column.getDefaultValue();

if ((defaultValue != null) && (defaultValue.length() >= 2)
&& defaultValue.startsWith("'") && defaultValue.endsWith("'")) {
defaultValue = defaultValue.substring(1, defaultValue.length() - 1);
column.setDefaultValue(defaultValue);
}
}
}
}
Expand Down

0 comments on commit b23c8c1

Please sign in to comment.