diff options
author | pfullbright | 2010-02-22 20:02:17 +0000 |
---|---|---|
committer | pfullbright | 2010-02-22 20:02:17 +0000 |
commit | 593e33f4727a261408a0c3fa66083e985cacafdf (patch) | |
tree | 42757c3482d073a7922ff1a49a7165e09221d6d9 /jpa | |
parent | 19c98e4134bb5d8cdbe3e1443a8ac58b41e711c4 (diff) | |
download | webtools.dali-593e33f4727a261408a0c3fa66083e985cacafdf.tar.gz webtools.dali-593e33f4727a261408a0c3fa66083e985cacafdf.tar.xz webtools.dali-593e33f4727a261408a0c3fa66083e985cacafdf.zip |
fixed npe for case when java type mapping for defaults is null
Diffstat (limited to 'jpa')
2 files changed, 12 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java index b088c7cc68..26fb1202a2 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java @@ -67,7 +67,7 @@ public class OrmEclipseLinkEntityImpl public boolean usesPrimaryKeyColumns() { return getResourceTypeMapping().getPrimaryKey() != null - || getJavaEntityForDefaults().usesPrimaryKeyColumns(); + || usesJavaPrimaryKeyColumns(); } public OrmEclipseLinkCaching getCaching() { @@ -135,6 +135,11 @@ public class OrmEclipseLinkEntityImpl return (javaEntity == null) ? null : javaEntity.getCaching(); } + protected boolean usesJavaPrimaryKeyColumns() { + JavaEclipseLinkEntity javaEntity = getJavaEntityForDefaults(); + return (javaEntity == null) ? false : javaEntity.usesPrimaryKeyColumns(); + } + // **************** validation ************************************** diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java index 758745a616..c82ef0fc9a 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java @@ -66,7 +66,7 @@ public class OrmEclipseLinkMappedSuperclassImpl public boolean usesPrimaryKeyColumns() { return getResourceTypeMapping().getPrimaryKey() != null - || getJavaMappedSuperclassForDefaults().usesPrimaryKeyColumns(); + || usesJavaPrimaryKeyColumns(); } public OrmEclipseLinkCaching getCaching() { @@ -134,6 +134,11 @@ public class OrmEclipseLinkMappedSuperclassImpl return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getCaching(); } + protected boolean usesJavaPrimaryKeyColumns() { + JavaEclipseLinkMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults(); + return (javaMappedSuperclass == null) ? false : javaMappedSuperclass.usesPrimaryKeyColumns(); + } + // **************** validation ************************************** |