This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git


The following commit(s) were added to refs/heads/master by this push:
     new f9b0906  OPENJPA-2809 ensure embeddabe too are enhanced
f9b0906 is described below

commit f9b0906c1baa080ea67b3b1b26430a2489013671
Author: Romain Manni-Bucau <rmannibu...@gmail.com>
AuthorDate: Mon Mar 23 08:45:20 2020 +0100

    OPENJPA-2809 ensure embeddabe too are enhanced
---
 .../java/org/apache/openjpa/junit5/internal/OpenJPAExtension.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/openjpa-junit5/src/main/java/org/apache/openjpa/junit5/internal/OpenJPAExtension.java
 
b/openjpa-junit5/src/main/java/org/apache/openjpa/junit5/internal/OpenJPAExtension.java
index 2761291..2478cad 100644
--- 
a/openjpa-junit5/src/main/java/org/apache/openjpa/junit5/internal/OpenJPAExtension.java
+++ 
b/openjpa-junit5/src/main/java/org/apache/openjpa/junit5/internal/OpenJPAExtension.java
@@ -39,6 +39,7 @@ import org.junit.platform.commons.util.AnnotationUtils;
 import serp.bytecode.BCClass;
 import serp.bytecode.Project;
 
+import javax.persistence.Embeddable;
 import javax.persistence.Entity;
 import javax.persistence.MappedSuperclass;
 import java.io.ByteArrayInputStream;
@@ -191,6 +192,7 @@ public class OpenJPAExtension implements BeforeAllCallback {
     private static class OpenJpaClassLoader extends BaseClassLoader {
         private static final String PERSITENCE_CAPABLE = 
Type.getDescriptor(PersistenceCapable.class);
         private static final String ENTITY = Type.getDescriptor(Entity.class);
+        private static final String EMBEDDABLE = 
Type.getDescriptor(Embeddable.class);
         private static final String MAPPED_SUPERCLASS = 
Type.getDescriptor(MappedSuperclass.class);
 
         private final MetaDataRepository repos;
@@ -280,7 +282,9 @@ public class OpenJPAExtension implements BeforeAllCallback {
 
                     @Override
                     public AnnotationVisitor visitAnnotation(final String 
descriptor, final boolean visible) {
-                        if (ENTITY.equals(descriptor) || 
MAPPED_SUPERCLASS.equals(descriptor)) {
+                        if (ENTITY.equals(descriptor) ||
+                                EMBEDDABLE.equals(descriptor) ||
+                                MAPPED_SUPERCLASS.equals(descriptor)) {
                             throw new MissingEnhancement(); // we already went 
into visit() so we miss the enhancement
                         }
                         return new EmptyVisitor().visitAnnotation(descriptor, 
visible);

Reply via email to