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

thiagohp pushed a commit to branch javax
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit dacf0ce2606f0b59cd75442cca9631acead42745
Author: Hendrik Noot <noot.hendr...@swm.de>
AuthorDate: Tue Jul 9 09:54:09 2024 +0200

    Fix for TAP5-2783 (NPE on init of the HibernateModule when entities with 
compound ids are used)
---
 .../org/apache/tapestry5/hibernate/web/modules/HibernateModule.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/tapestry-hibernate/src/main/java/org/apache/tapestry5/hibernate/web/modules/HibernateModule.java
 
b/tapestry-hibernate/src/main/java/org/apache/tapestry5/hibernate/web/modules/HibernateModule.java
index 0fa210926..8ca7403bc 100644
--- 
a/tapestry-hibernate/src/main/java/org/apache/tapestry5/hibernate/web/modules/HibernateModule.java
+++ 
b/tapestry-hibernate/src/main/java/org/apache/tapestry5/hibernate/web/modules/HibernateModule.java
@@ -102,7 +102,7 @@ public class HibernateModule
         for (EntityType<?> entityType : entities)
         {
             Class<?> entityClass = entityType.getJavaType();
-            if (entityClass != null)
+            if (entityClass != null && entityType.hasSingleIdAttribute())
             {
                 SingularAttribute<?, ?> id = 
entityType.getId(entityType.getIdType().getJavaType());
                 final String idenfierPropertyName = id.getName();

Reply via email to