openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1591689 - in /openjpa/trunk: ./ openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Date Thu, 01 May 2014 15:47:53 GMT
Author: hthomann
Date: Thu May  1 15:47:53 2014
New Revision: 1591689

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

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

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

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=1591689&r1=1591688&r2=1591689&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Thu May  1 15:47:53 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.warn(_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