Skip to content

Commit

Permalink
TEIIDDES-1010 fixed issues creating/naming indexes
Browse files Browse the repository at this point in the history
includes fixing the Name In Source value
  • Loading branch information
blafond committed Feb 7, 2013
1 parent d25adce commit 939c714
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,9 @@ protected Index findIndex( final Table table,
resource.getContents().add(index);
}
setNameAndNameInSource(index, spec.indexName, tableNode, context, problems);
String quoteStr = getQuoteString(context, problems);
String nis = index.getNameInSource() + '.' + quoteStr + spec.indexName + quoteStr;
index.setNameInSource(nis);
index.setUnique(!spec.nonUnique);
index.getColumns().addAll(spec.columns);
index.setFilterCondition(spec.filterCondition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected List createIndexes( final JdbcTable tableNode,
final PrimaryKey pk = theTable.getPrimaryKey();
if (pk != null) {
final String pkName = pk.getName();
if (pkName == null || pkName.trim().length() != 0) {
if (pkName == null || pkName.trim().length() == 0) {
final List pkColumns = pk.getColumns();

// Iterate over the indexes for the table ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,19 +427,19 @@ public List getOtherModifiedResources() {
* handler for Create Relationships Model Button pressed
*/
private ModelResource createRelationalModel(IResource targetRes, String sNewRelationshipModelName ) {
ModelResource mrRelationshipModel = constructRelationalModel(targetRes , sNewRelationshipModelName );
ModelResource mr = constructRelationalModel(targetRes , sNewRelationshipModelName );

// Save Relationship Model
try {
if( mrRelationshipModel != null ) {
mrRelationshipModel.save( null, false );
if( mr != null ) {
mr.save( null, false );

}
} catch (ModelWorkspaceException mwe) {
UiConstants.Util.log( mwe );
}

return mrRelationshipModel;
return mr;
}

/**
Expand Down

0 comments on commit 939c714

Please sign in to comment.