[seam-commits] Seam SVN: r9439 - branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Oct 27 11:03:45 EDT 2008


Author: manaRH
Date: 2008-10-27 11:03:45 -0400 (Mon, 27 Oct 2008)
New Revision: 9439

Modified:
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
Log:
JBPAPP-1319

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java	2008-10-27 14:37:33 UTC (rev 9438)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java	2008-10-27 15:03:45 UTC (rev 9439)
@@ -16,6 +16,7 @@
 import org.hibernate.StaleStateException;
 import org.hibernate.TransientObjectException;
 import org.hibernate.metadata.ClassMetadata;
+import org.hibernate.proxy.HibernateProxy;
 import org.hibernate.type.VersionType;
 import org.jboss.seam.Component;
 import org.jboss.seam.Entity;
@@ -166,7 +167,14 @@
        }
        catch (TransientObjectException e) 
        {
-          return super.getId(bean, entityManager);
+          if (bean instanceof HibernateProxy)
+          {
+             return super.getId(((HibernateProxy) bean).getHibernateLazyInitializer().getImplementation(), entityManager);
+          }
+          else
+          {
+             return super.getId(bean, entityManager);
+          }
        }
    }
    




More information about the seam-commits mailing list