Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractSecondaryTablesComposite.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractSecondaryTablesComposite.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractSecondaryTablesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractSecondaryTablesComposite.java
index 4f9337e4b5..e7cccff23c 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractSecondaryTablesComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractSecondaryTablesComposite.java
@@ -85,8 +85,12 @@ public abstract class AbstractSecondaryTablesComposite<T extends Entity> extends
String schema = dialog.getSelectedSchema();
SecondaryTable secondaryTable = this.subject().addSpecifiedSecondaryTable(index);
secondaryTable.setSpecifiedName(name);
- secondaryTable.setSpecifiedCatalog(catalog);
- secondaryTable.setSpecifiedSchema(schema);
+ if (!dialog.isDefaultCatalogSelected()) {
+ secondaryTable.setSpecifiedCatalog(catalog);
+ }
+ if (!dialog.isDefaultSchemaSelected()) {
+ secondaryTable.setSpecifiedSchema(schema);
+ }
listSelectionModel.setSelectedValue(secondaryTable);
}
@@ -110,11 +114,15 @@ public abstract class AbstractSecondaryTablesComposite<T extends Entity> extends
};
}
+ protected SecondaryTableDialog buildSecondaryTableDialogForAdd() {
+ return new SecondaryTableDialog(getControl().getShell(), subject().getJpaProject(), subject().getTable().getDefaultSchema(), subject().getTable().getDefaultCatalog());
+ }
+
protected AddRemoveListPane.Adapter buildSecondaryTablesAdapter() {
return new AddRemoveListPane.AbstractAdapter() {
public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- SecondaryTableDialog dialog = new SecondaryTableDialog(getControl().getShell(), subject());
+ SecondaryTableDialog dialog = buildSecondaryTableDialogForAdd();
addSecondaryTableFromDialog(dialog, listSelectionModel);
}
@@ -131,7 +139,7 @@ public abstract class AbstractSecondaryTablesComposite<T extends Entity> extends
@Override
public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
SecondaryTable secondaryTable = (SecondaryTable) listSelectionModel.selectedValue();
- SecondaryTableDialog dialog = new SecondaryTableDialog(getControl().getShell(), secondaryTable, subject());
+ SecondaryTableDialog dialog = new SecondaryTableDialog(getControl().getShell(), secondaryTable, subject().getJpaProject());
editSecondaryTableFromDialog(dialog, secondaryTable);
}

Back to the top