Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2007-05-29 19:26:20 +0000
committerkmoore2007-05-29 19:26:20 +0000
commit1056129e8fcdc046e3321b39c1088f96f05509b9 (patch)
tree092397a1b88daa1b3bd750256d7e2518545f20f3
parent000ca1a532fe644a2e4d5a041e47bbf9dfd98c4e (diff)
downloadwebtools.dali-1056129e8fcdc046e3321b39c1088f96f05509b9.tar.gz
webtools.dali-1056129e8fcdc046e3321b39c1088f96f05509b9.tar.xz
webtools.dali-1056129e8fcdc046e3321b39c1088f96f05509b9.zip
188979 -secondary table pkJoinColumn defaults not appearing in orm.xml
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java1
2 files changed, 16 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java
index 0ba185d086..bbb7425837 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPrimaryKeyJoinColumn.java
@@ -18,6 +18,8 @@ import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
+import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform;
+import org.eclipse.jpt.core.internal.platform.DefaultsContext;
import org.eclipse.jpt.db.internal.Column;
import org.eclipse.jpt.db.internal.Table;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
@@ -195,6 +197,13 @@ public class XmlPrimaryKeyJoinColumn extends AbstractXmlNamedColumn
public String getDefaultReferencedColumnName() {
return defaultReferencedColumnName;
}
+
+ protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
+ String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
+ this.defaultReferencedColumnName = newDefaultReferencedColumnName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME, oldDefaultReferencedColumnName, newDefaultReferencedColumnName));
+ }
public void setColumnDefinition(String newColumnDefinition) {
setColumnDefinitionGen(newColumnDefinition);
@@ -413,4 +422,10 @@ public class XmlPrimaryKeyJoinColumn extends AbstractXmlNamedColumn
IDOMNode referencedColumnNameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.REFERENCED_COLUMN_NAME);
return (referencedColumnNameNode == null) ? validationTextRange() : buildTextRange(referencedColumnNameNode);
}
+
+ public void refreshDefaults(DefaultsContext defaultsContext) {
+ setDefaultReferencedColumnName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_REFERENCED_COLUMN_NAME_KEY));
+ setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_COLUMN_NAME_KEY));
+ }
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java
index 6fde7390a2..8295c68dfe 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlSecondaryTable.java
@@ -60,6 +60,7 @@ public class XmlSecondaryTable extends AbstractXmlTable
protected XmlSecondaryTable(Owner owner) {
super(owner);
+ this.getDefaultPrimaryKeyJoinColumns().add(this.createPrimaryKeyJoinColumn(0));
}
/**

Back to the top