if (_manyToMany) {
String joinEntityName = _joinEntityNameText.getText();
boolean flatten = _flattenButton.getSelection();
NewManyToManyRelationshipOperation operation = new NewManyToManyRelationshipOperation(_sourceEntity, _destinationEntity, createRelationship, name, createInverseRelationship, inverseName, joinEntityName, flatten);
operation.addContext(EOModelUtils.getUndoContext(_sourceEntity));
IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
operationHistory.execute(operation, null, null);
// _sourceEntity.joinInManyToManyWith(_destinationEntity,
// createRelationship, name, createInverseRelationship,
// inverseName, joinEntityName, flatten);
} else {
String fkName = null;
String fkColumnName = null;
boolean toMany = _toManyButton.getSelection();
String inverseFKName = null;
String inverseFKColumnName = null;
boolean inverseToMany = _inverseToManyButton.getSelection();
if (_createFK) {
fkName = _fkNameText.getText();
fkColumnName = _fkColumnNameText.getText();
}
if (_createInverseFK) {
inverseFKName = _inverseFKNameText.getText();
inverseFKColumnName = _inverseFKColumnNameText.getText();
}
NewOneToManyRelationshipOperation operation = new NewOneToManyRelationshipOperation(_relationship, _sourceEntity, name, createRelationship, toMany, _createFK, fkName, fkColumnName, _destinationEntity, inverseName, createInverseRelationship, inverseToMany, _createInverseFK, inverseFKName, inverseFKColumnName);
operation.addContext(EOModelUtils.getUndoContext(_sourceEntity));
IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
operationHistory.execute(operation, null, null);
}
super.okPressed();
} catch (Throwable t) {