deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1066 [perf] enhance caching in RepositoryEntity
Date Mon, 14 Mar 2016 22:31:03 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 1c23b4cad -> 72b12c72e


DELTASPIKE-1066 [perf] enhance caching in RepositoryEntity

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/72b12c72
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/72b12c72
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/72b12c72

Branch: refs/heads/master
Commit: 72b12c72e08f1b0c3c3716ee798b9814063bb774
Parents: 1c23b4c
Author: Thomas Andraschko <tandraschko@apache.org>
Authored: Mon Mar 14 23:30:49 2016 +0100
Committer: Thomas Andraschko <tandraschko@apache.org>
Committed: Mon Mar 14 23:30:49 2016 +0100

----------------------------------------------------------------------
 .../impl/handler/CdiQueryInvocationContext.java | 16 +++---
 .../impl/handler/EntityRepositoryHandler.java   | 18 +------
 .../data/impl/meta/RepositoryComponent.java     | 24 +++++----
 .../data/impl/meta/RepositoryComponents.java    |  2 -
 .../data/impl/meta/RepositoryEntity.java        | 56 ++++++++++++++++----
 .../meta/extractor/TypeMetadataExtractor.java   |  2 +-
 .../deltaspike/data/impl/util/EntityUtils.java  | 32 ++++++++---
 .../jpa/OpenJpaPersistenceUnitUtilDelegate.java |  1 +
 .../AnnotationMetadataExtractorTest.java        |  2 +-
 .../extractor/TypeMetadataExtractorTest.java    |  2 +-
 .../impl/meta/unit/PersistenceUnitsTest.java    |  6 +--
 11 files changed, 104 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
index e74e022..4505f6a 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
@@ -97,21 +97,25 @@ public class CdiQueryInvocationContext implements QueryInvocationContext
     {
         try
         {
-            Property<Serializable> versionProperty = EntityUtils.getVersionProperty(entity);
+            Property<Serializable> versionProperty =
+                    repoMethod.getRepository().getRepositoryEntity().getVersionProperty();
             if (versionProperty != null)
             {
                 return versionProperty.getValue(entity) == null;
             }
 
-            if (EntityUtils.primaryKeyValue(entity) == null)
+            Property<Serializable> primaryKeyProperty =
+                    repoMethod.getRepository().getRepositoryEntity().getPrimaryKeyProperty();
+            if (EntityUtils.primaryKeyValue(entity, primaryKeyProperty) == null)
             {
                 return true;
             }
 
-            if (!entityManager.contains(entity) && countCheck(entity))
+            if (!entityManager.contains(entity) && countCheck(entity, primaryKeyProperty))
             {
                 return true;
             }
+
             return false;
         }
         catch (IllegalArgumentException e)
@@ -326,16 +330,16 @@ public class CdiQueryInvocationContext implements QueryInvocationContext
         query.setHint(entityGraphAnn.type().getHintName(), graph);
     }
 
-    private boolean countCheck(Object entity)
+    private boolean countCheck(Object entity, Property<Serializable> primaryKeyProperty)
     {
         StringBuilder jpql = new StringBuilder("SELECT COUNT(e) FROM " + getEntityClass()
                 .getSimpleName() + " e ");
         jpql.append("WHERE e.");
-        jpql.append(EntityUtils.primaryKey(getEntityClass()).getName());
+        jpql.append(primaryKeyProperty.getName());
         jpql.append(" = :id");
 
         final Query query = entityManager.createQuery(jpql.toString());
-        query.setParameter("id", EntityUtils.primaryKeyValue(entity));
+        query.setParameter("id", EntityUtils.primaryKeyValue(entity, primaryKeyProperty));
         final Long result = (Long) query.getSingleResult();
         if (Long.valueOf(0).equals(result))
         {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java
index 19fa0fa..ce5a473 100755
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java
@@ -18,11 +18,9 @@
  */
 package org.apache.deltaspike.data.impl.handler;
 
-import org.apache.deltaspike.core.util.StringUtils;
 import org.apache.deltaspike.data.api.EntityRepository;
 import org.apache.deltaspike.data.impl.builder.QueryBuilder;
 import org.apache.deltaspike.data.impl.meta.RequiresTransaction;
-import org.apache.deltaspike.data.impl.meta.unit.PersistenceUnits;
 import org.apache.deltaspike.data.impl.property.Property;
 import org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria;
 import org.apache.deltaspike.data.impl.property.query.PropertyQueries;
@@ -33,10 +31,8 @@ import org.apache.deltaspike.data.spi.DelegateQueryHandler;
 import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceUnitUtil;
-import javax.persistence.Table;
 import javax.persistence.TypedQuery;
 import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.metamodel.EntityType;
 import javax.persistence.metamodel.SingularAttribute;
 
 import java.io.Serializable;
@@ -236,22 +232,12 @@ public class EntityRepositoryHandler<E, PK extends Serializable>
 
     public String tableName()
     {
-        final Class<?> entityClass = context.getEntityClass();
-        final String tableName = PersistenceUnits.instance().entityTableName(entityClass);
-        if (StringUtils.isEmpty(tableName))
-        {
-            final EntityType<?> entityType = entityManager().getMetamodel().entity(entityClass);
-            Table tableAnnotation = entityClass.getAnnotation(Table.class);
-            return (tableAnnotation == null)
-                    ? entityType.getName()
-                    : tableAnnotation.name();
-        }
-        return tableName;
+        return EntityUtils.tableName(context.getEntityClass(), entityManager());
     }
 
     public String entityName()
     {
-        return EntityUtils.entityName(entityClass());
+        return context.getRepositoryMethod().getRepository().getRepositoryEntity().getEntityName();
     }
 
     // ----------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponent.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponent.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponent.java
index 3d74952..a98b558 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponent.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponent.java
@@ -37,7 +37,6 @@ import org.apache.deltaspike.core.api.provider.BeanManagerProvider;
 import org.apache.deltaspike.data.api.EntityManagerConfig;
 import org.apache.deltaspike.data.api.EntityManagerResolver;
 import org.apache.deltaspike.data.api.Repository;
-import org.apache.deltaspike.data.impl.util.EntityUtils;
 
 /**
  * Stores information about a specific Repository. Extracts information about:
@@ -56,20 +55,20 @@ public class RepositoryComponent
     private volatile Boolean entityManagerResolverIsNormalScope;
 
     private final Class<?> repoClass;
-    private final RepositoryEntity entityClass;
+    private final RepositoryEntity repositoryEntity;
     private final Class<? extends EntityManagerResolver> entityManagerResolver;
     private final FlushModeType entityManagerFlushMode;
 
     private final Map<Method, RepositoryMethod> methods = new HashMap<Method, RepositoryMethod>();
 
-    public RepositoryComponent(Class<?> repoClass, RepositoryEntity entityClass)
+    public RepositoryComponent(Class<?> repoClass, RepositoryEntity repositoryEntity)
     {
-        if (entityClass == null)
+        if (repositoryEntity == null)
         {
-            throw new IllegalArgumentException("Entity class cannot be null");
+            throw new IllegalArgumentException("repositoryEntity cannot be null");
         }
         this.repoClass = repoClass;
-        this.entityClass = entityClass;
+        this.repositoryEntity = repositoryEntity;
         this.entityManagerResolver = extractEntityManagerResolver(repoClass);
         this.entityManagerFlushMode = extractEntityManagerFlushMode(repoClass);
     }
@@ -110,7 +109,7 @@ public class RepositoryComponent
 
     public String getEntityName()
     {
-        return EntityUtils.entityName(entityClass.getEntityClass());
+        return repositoryEntity.getEntityName();
     }
 
     /**
@@ -143,7 +142,7 @@ public class RepositoryComponent
      */
     public Class<?> getEntityClass()
     {
-        return entityClass.getEntityClass();
+        return repositoryEntity.getEntityClass();
     }
 
     /**
@@ -153,9 +152,14 @@ public class RepositoryComponent
      */
     public Class<? extends Serializable> getPrimaryKey()
     {
-        return entityClass.getPrimaryClass();
+        return repositoryEntity.getPrimaryKeyClass();
     }
-
+    
+    public RepositoryEntity getRepositoryEntity()
+    {
+        return repositoryEntity;
+    }
+    
     /**
      * Returns the original Repository class this meta data is related to.
      *

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponents.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponents.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponents.java
index 2e3d493..e0fba0f 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponents.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryComponents.java
@@ -43,9 +43,7 @@ public class RepositoryComponents
     /**
      * Add a Repository class to the meta data repository.
      *
-     *
      * @param repoClass  The repo class.
-     * @return {@code true} if Repository class has been added, {@code false} otherwise.
      */
     public void add(Class<?> repoClass)
     {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryEntity.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryEntity.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryEntity.java
index 17ec297..b45fbff 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryEntity.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryEntity.java
@@ -19,19 +19,20 @@
 package org.apache.deltaspike.data.impl.meta;
 
 import java.io.Serializable;
+import org.apache.deltaspike.data.impl.property.Property;
+import org.apache.deltaspike.data.impl.util.EntityUtils;
 
 /**
- * Data structure to store information about an entity:
- * <ul>
- * <li>Stores the class of the entity</li>
- * <li>Stores the primary key class</li>
- * </ul>
+ * Data structure to store information about an entity.
  */
 public class RepositoryEntity
 {
 
     private Class<?> entityClass;
-    private Class<? extends Serializable> primaryClass;
+    private Class<? extends Serializable> primaryKeyClass;
+    private Property<Serializable> primaryKeyProperty;
+    private Property<Serializable> versionProperty;
+    private String entityName;
 
     public RepositoryEntity(Class<?> entityClass)
     {
@@ -41,7 +42,11 @@ public class RepositoryEntity
     public RepositoryEntity(Class<?> entityClass, Class<? extends Serializable>
primaryClass)
     {
         this.entityClass = entityClass;
-        this.primaryClass = primaryClass;
+        this.primaryKeyClass = primaryClass;
+        
+        this.primaryKeyProperty = EntityUtils.primaryKeyProperty(entityClass);
+        this.versionProperty = EntityUtils.getVersionProperty(entityClass);
+        this.entityName = EntityUtils.entityName(entityClass);
     }
 
     public Class<?> getEntityClass()
@@ -54,14 +59,43 @@ public class RepositoryEntity
         this.entityClass = entityClass;
     }
 
-    public Class<? extends Serializable> getPrimaryClass()
+    public Class<? extends Serializable> getPrimaryKeyClass()
     {
-        return primaryClass;
+        return primaryKeyClass;
     }
 
-    public void setPrimaryClass(Class<? extends Serializable> primaryClass)
+    public void setPrimaryKeyClass(Class<? extends Serializable> primaryKeyClass)
     {
-        this.primaryClass = primaryClass;
+        this.primaryKeyClass = primaryKeyClass;
     }
 
+    public Property<Serializable> getVersionProperty()
+    {
+        return versionProperty;
+    }
+
+    public void setVersionProperty(Property<Serializable> versionProperty)
+    {
+        this.versionProperty = versionProperty;
+    }
+
+    public String getEntityName()
+    {
+        return entityName;
+    }
+
+    public void setEntityName(String entityName)
+    {
+        this.entityName = entityName;
+    }
+
+    public Property<Serializable> getPrimaryKeyProperty()
+    {
+        return primaryKeyProperty;
+    }
+
+    public void setPrimaryKeyProperty(Property<Serializable> primaryKeyProperty)
+    {
+        this.primaryKeyProperty = primaryKeyProperty;
+    }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractor.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractor.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractor.java
index 8b36d39..f02a621 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractor.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractor.java
@@ -83,7 +83,7 @@ public class TypeMetadataExtractor implements MetadataExtractor
             }
             if (result != null && genericType instanceof Class)
             {
-                result.setPrimaryClass((Class<? extends Serializable>) genericType);
+                result.setPrimaryKeyClass((Class<? extends Serializable>) genericType);
                 return result;
             }
         }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/EntityUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/EntityUtils.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/EntityUtils.java
index b3e1ac5..ec38e34 100755
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/EntityUtils.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/EntityUtils.java
@@ -24,9 +24,13 @@ import java.util.List;
 
 import javax.persistence.EmbeddedId;
 import javax.persistence.Entity;
+import javax.persistence.EntityManager;
 import javax.persistence.Id;
 import javax.persistence.IdClass;
+import javax.persistence.Table;
 import javax.persistence.Version;
+import javax.persistence.metamodel.EntityType;
+import org.apache.deltaspike.core.util.StringUtils;
 
 import org.apache.deltaspike.data.impl.meta.unit.PersistenceUnits;
 import org.apache.deltaspike.data.impl.meta.verifier.EntityVerifier;
@@ -57,16 +61,21 @@ public final class EntityUtils
         {
             return clazz;
         }
-        Property<Serializable> property = primaryKey(entityClass);
+        Property<Serializable> property = primaryKeyProperty(entityClass);
         return property.getJavaClass();
     }
 
     public static Object primaryKeyValue(Object entity)
     {
-        Property<Serializable> property = primaryKey(entity.getClass());
-        return property.getValue(entity);
+        Property<Serializable> property = primaryKeyProperty(entity.getClass());
+        return primaryKeyValue(entity, property);
     }
 
+    public static Object primaryKeyValue(Object entity, Property<Serializable> primaryKeyProperty)
+    {
+        return primaryKeyProperty.getValue(entity);
+    }
+    
     public static String entityName(Class<?> entityClass)
     {
         String result = null;
@@ -81,12 +90,24 @@ public final class EntityUtils
         return (result != null && !"".equals(result)) ? result : entityClass.getSimpleName();
     }
 
+    public static String tableName(Class<?> entityClass, EntityManager entityManager)
+    {
+        String tableName = PersistenceUnits.instance().entityTableName(entityClass);
+        if (StringUtils.isEmpty(tableName))
+        {
+            EntityType<?> entityType = entityManager.getMetamodel().entity(entityClass);
+            Table tableAnnotation = entityClass.getAnnotation(Table.class);
+            return tableAnnotation == null ? entityType.getName() : tableAnnotation.name();
+        }
+        return tableName;
+    }
+    
     public static boolean isEntityClass(Class<?> entityClass)
     {
         return new EntityVerifier().verify(entityClass);
     }
 
-    public static Property<Serializable> primaryKey(Class<?> entityClass)
+    public static Property<Serializable> primaryKeyProperty(Class<?> entityClass)
     {
         for (PropertyCriteria c : criteriaList(entityClass))
         {
@@ -113,9 +134,8 @@ public final class EntityUtils
         return criteria;
     }
 
-    public static Property<Serializable> getVersionProperty(Object entity)
+    public static Property<Serializable> getVersionProperty(Class<?> entityClass)
     {
-        Class<?> entityClass = entity.getClass();
         List<PropertyCriteria> criteriaList = new LinkedList<PropertyCriteria>();
         criteriaList.add(new AnnotatedPropertyCriteria(Version.class));
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/OpenJpaPersistenceUnitUtilDelegate.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/OpenJpaPersistenceUnitUtilDelegate.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/OpenJpaPersistenceUnitUtilDelegate.java
index 6928e9a..7424bc6 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/OpenJpaPersistenceUnitUtilDelegate.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/util/jpa/OpenJpaPersistenceUnitUtilDelegate.java
@@ -48,6 +48,7 @@ public class OpenJpaPersistenceUnitUtilDelegate implements PersistenceUnitUtil
         return persistenceUnitUtil.isLoaded(entity);
     }
 
+    @Override
     public Object getIdentifier(Object entity)
     {
         final String methodName = "getIdObject";

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/AnnotationMetadataExtractorTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/AnnotationMetadataExtractorTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/AnnotationMetadataExtractorTest.java
index 99aa24f..7919990 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/AnnotationMetadataExtractorTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/AnnotationMetadataExtractorTest.java
@@ -43,7 +43,7 @@ public class AnnotationMetadataExtractorTest
         // then
         assertNotNull(result);
         assertEquals(Simple.class, result.getEntityClass());
-        assertEquals(Long.class, result.getPrimaryClass());
+        assertEquals(Long.class, result.getPrimaryKeyClass());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractorTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractorTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractorTest.java
index af2fcda..d36d998 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractorTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/extractor/TypeMetadataExtractorTest.java
@@ -45,7 +45,7 @@ public class TypeMetadataExtractorTest
         // then
         assertNotNull(result);
         assertEquals(Simple.class, result.getEntityClass());
-        assertEquals(Long.class, result.getPrimaryClass());
+        assertEquals(Long.class, result.getPrimaryKeyClass());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72b12c72/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/PersistenceUnitsTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/PersistenceUnitsTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/PersistenceUnitsTest.java
index dfcbf8d..b9bfb88 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/PersistenceUnitsTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/meta/unit/PersistenceUnitsTest.java
@@ -129,9 +129,9 @@ public class PersistenceUnitsTest
         // then
         assertNotNull(entity1);
         assertNotNull(entity2);
-        assertEquals(Long.class, entity1.getPrimaryClass());
-        assertEquals(TeeId.class, entity2.getPrimaryClass());
-        assertEquals(Long.class, entity3.getPrimaryClass());
+        assertEquals(Long.class, entity1.getPrimaryKeyClass());
+        assertEquals(TeeId.class, entity2.getPrimaryKeyClass());
+        assertEquals(Long.class, entity3.getPrimaryKeyClass());
     }
 
 }


Mime
View raw message