summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Butzke2012-09-26 07:17:22 (EDT)
committerKaren Butzke2012-09-26 08:42:41 (EDT)
commitc8626e0adc26f2ad38a485cef71a39ef8e57ac4b (patch)
treef4ea757804db7394556c7169f1d0d50dfea8843a
parentc1276439d6c72fe843514421fb497f603a34eb6b (diff)
downloadwebtools.dali-c8626e0adc26f2ad38a485cef71a39ef8e57ac4b.zip
webtools.dali-c8626e0adc26f2ad38a485cef71a39ef8e57ac4b.tar.gz
webtools.dali-c8626e0adc26f2ad38a485cef71a39ef8e57ac4b.tar.bz2
minor change to Nan's patch, building a null Owner implementation instead of checking for null.
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOrderable.java21
2 files changed, 35 insertions, 6 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java
index 5bab411..bc684da 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java
@@ -61,7 +61,7 @@ public class GenericJavaOrderable
* JPA 1.0
*/
public GenericJavaOrderable(JavaAttributeMapping parent) {
- this(parent, null);
+ this(parent, buildNullOwner());
}
/**
@@ -79,6 +79,20 @@ public class GenericJavaOrderable
this.orderColumn = this.buildOrderColumn();
}
+ /**
+ * null Owner implementation for JPA 1.0 where there is no OrderColumn
+ */
+ static Owner buildNullOwner() {
+ return new Owner() {
+ public Table resolveDbTable(String tableName) {
+ return null;
+ }
+ public String getTableName() {
+ return null;
+ }
+ };
+ }
+
// ********** synchronize/update **********
@@ -388,12 +402,12 @@ public class GenericJavaOrderable
// JPA 2.0 only
public String getDefaultTableName() {
- return this.owner == null ? null : this.owner.getTableName();
+ return this.owner.getTableName();
}
// JPA 2.0 only
protected Table resolveDbTable(String tableName) {
- return this.owner == null ? null : this.owner.resolveDbTable(tableName);
+ return this.owner.resolveDbTable(tableName);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOrderable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOrderable.java
index 968ecb6..79cc2cc 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOrderable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOrderable.java
@@ -58,7 +58,7 @@ public class GenericOrmOrderable
* JPA 1.0
*/
public GenericOrmOrderable(OrmAttributeMapping parent) {
- this(parent, null);
+ this(parent, buildNullOwner());
}
/**
@@ -78,6 +78,21 @@ public class GenericOrmOrderable
}
+ /**
+ * null Owner implementation for JPA 1.0 where there is no OrderColumn
+ */
+ static Owner buildNullOwner() {
+ return new Owner() {
+ public Table resolveDbTable(String tableName) {
+ return null;
+ }
+ public String getTableName() {
+ return null;
+ }
+ };
+ }
+
+
// ********** synchronize/update **********
@Override
@@ -373,12 +388,12 @@ public class GenericOrmOrderable
// JPA 2.0
public String getDefaultTableName() {
- return this.owner == null ? null : this.owner.getTableName();
+ return this.owner.getTableName();
}
// JPA 2.0
protected Table resolveDbTable(String tableName) {
- return this.owner == null ? null : this.owner.resolveDbTable(tableName);
+ return this.owner.resolveDbTable(tableName);
}