summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li2013-03-06 23:38:09 (EST)
committerNeil Hauge2013-03-06 23:46:12 (EST)
commit1f72077c7629946ba726be097d19ca2a02e13f99 (patch)
treeee82e86daa3a530802f2365717396773fa8193f3
parentd5fbcbce1d37fbf48b086a54e7164c365aeeb9e1 (diff)
downloadwebtools.dali-1f72077c7629946ba726be097d19ca2a02e13f99.zip
webtools.dali-1f72077c7629946ba726be097d19ca2a02e13f99.tar.gz
webtools.dali-1f72077c7629946ba726be097d19ca2a02e13f99.tar.bz2
401839 - Fix composite PK FK mappings in Entity Generation.v201303070505
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java
index 6fed057..dff7f17 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java
@@ -370,7 +370,9 @@ public class ORMGenColumn
}
public boolean isUpdateable() {
- return !"false".equals(customized(UPDATEABLE)); //defaults to true //$NON-NLS-1$
+ return (this.isForeignKey() && this.isPartOfCompositePrimaryKey()) ?
+ false :
+ !"false".equals(customized(UPDATEABLE)); //defaults to true //$NON-NLS-1$
}
public void setUpdateable(boolean value) {
@@ -378,7 +380,9 @@ public class ORMGenColumn
}
public boolean isInsertable() {
- return !"false".equals(customized(INSERTABLE)); //defaults to true //$NON-NLS-1$
+ return (this.isForeignKey() && this.isPartOfCompositePrimaryKey()) ?
+ false :
+ !"false".equals(customized(INSERTABLE)); //defaults to true //$NON-NLS-1$
}
public void setInsertable(boolean value) {