openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1591685 - in /openjpa/branches/2.3.x: ./ openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Date Thu, 01 May 2014 15:44:56 GMT
Author: hthomann
Date: Thu May  1 15:44:56 2014
New Revision: 1591685

URL: http://svn.apache.org/r1591685
Log:
OPENJPA-2478: Fixed erroneous message from the enhancer when a Mapped Superclass contains
an @Id.

Modified:
    openjpa/branches/2.3.x/   (props changed)
    openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java

Propchange: openjpa/branches/2.3.x/
------------------------------------------------------------------------------
  Merged /openjpa/branches/2.2.x:r1591681

Modified: openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=1591685&r1=1591684&r2=1591685&view=diff
==============================================================================
--- openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
(original)
+++ openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Thu May  1 15:44:56 2014
@@ -1180,7 +1180,7 @@ public class PCEnhancer { 
                 addGetIDOwningClass();
             }
             
-            if (_meta.isEmbeddedOnly() && _meta.getIdentityType() == ClassMetaData.ID_APPLICATION)
{
+            if (_meta.isEmbeddable() && _meta.getIdentityType() == ClassMetaData.ID_APPLICATION)
{
                 _log.error(_loc.get("ID-field-in-embeddable-unsupported", _meta.toString()));
             }
             
@@ -2753,8 +2753,9 @@ public class PCEnhancer { 
         code.anew().setType(oidType);
         code.dup();
         if (_meta.isOpenJPAIdentity() || (obj && usesClsString == Boolean.TRUE))
{
-            if ((_meta.isEmbeddedOnly() && ! (_meta.getIdentityType() == ClassMetaData.ID_APPLICATION))
-                || _meta.hasAbstractPKField() == true ) {
+            if ((_meta.isEmbeddedOnly() 
+                && !(_meta.isEmbeddable() && _meta.getIdentityType() == ClassMetaData.ID_APPLICATION))
+                || _meta.hasAbstractPKField() == true) {
                 code.aload().setThis();
                 code.invokevirtual().setMethod(PRE + "GetIDOwningClass", Class.class, null);
             } else {



Mime
View raw message