Skip to content

Commit

Permalink
TEIIDDES-1660 added check in createKey() for columns that are Nullabl…
Browse files Browse the repository at this point in the history
…e or undefined, and change to Not Nullable
  • Loading branch information
blafond committed May 6, 2013
1 parent 9c6c95e commit eded7d7
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,12 @@ private void createKey( final AstNode node,
initialize(key, node);
for (final AstNode node1 : node) {
if (node1.hasMixin(StandardDdlLexicon.TYPE_COLUMN_REFERENCE)) try {
key.getColumns().add(find(Column.class, node1, table, roots));
Column column = find(Column.class, node1, table, roots);

if( column.getNullable() == NullableType.NULLABLE_UNKNOWN_LITERAL || column.getNullable() == NullableType.NULLABLE_LITERAL ) {
column.setNullable(NullableType.NO_NULLS_LITERAL);
}
key.getColumns().add(column);
} catch (final EntityNotFoundException error) {
messages.add(error.getMessage());
}
Expand Down Expand Up @@ -732,7 +737,12 @@ else for (final Object obj : foreignTable.getUniqueConstraints()) {
initialize(key, node);
for (final AstNode node1 : node) {
if (node1.hasMixin(StandardDdlLexicon.TYPE_COLUMN_REFERENCE)) try {
key.getColumns().add(find(Column.class, node1, table, roots));
Column column = find(Column.class, node1, table, roots);

if( column.getNullable() == NullableType.NULLABLE_UNKNOWN_LITERAL || column.getNullable() == NullableType.NULLABLE_LITERAL ) {
column.setNullable(NullableType.NO_NULLS_LITERAL);
}
key.getColumns().add(column);
} catch (final EntityNotFoundException error) {
messages.add(error.getMessage());
}
Expand Down

0 comments on commit eded7d7

Please sign in to comment.