[seam-commits] Seam SVN: r7665 - in trunk/src/main/org/jboss/seam: security and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Mar 20 15:06:37 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-03-20 15:06:36 -0400 (Thu, 20 Mar 2008)
New Revision: 7665

Modified:
   trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
   trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
   trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java
Log:
pass in entity manager for getXXXMethod() methods

Modified: trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java	2008-03-20 18:59:19 UTC (rev 7664)
+++ trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java	2008-03-20 19:06:36 UTC (rev 7665)
@@ -323,25 +323,25 @@
    }
    
    /*@Override
-   public Method getPostLoadMethod(Class beanClass)
+   public Method getPostLoadMethod(Class beanClass, EntityManager entityManager)
    {
       return null;      
    }
    
    @Override
-   public Method getPrePersistMethod(Class beanClass)
+   public Method getPrePersistMethod(Class beanClass, EntityManager entityManager)
    {
       return null;
    }
    
    @Override
-   public Method getPreUpdateMethod(Class beanClass)
+   public Method getPreUpdateMethod(Class beanClass, EntityManager entityManager)
    {
       return null;
    }
    
    @Override
-   public Method getPreRemoveMethod(Class beanClass)
+   public Method getPreRemoveMethod(Class beanClass, EntityManager entityManager)
    {
       return null;
    }*/

Modified: trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java	2008-03-20 18:59:19 UTC (rev 7664)
+++ trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java	2008-03-20 19:06:36 UTC (rev 7665)
@@ -151,22 +151,22 @@
       return Entity.forClass(bean.getClass()).getBeanClass();
    }
    
-   public Method getPostLoadMethod(Class beanClass)
+   public Method getPostLoadMethod(Class beanClass, EntityManager entityManager)
    {
       return Entity.forClass(beanClass).getPostLoadMethod();      
    }
    
-   public Method getPrePersistMethod(Class beanClass)
+   public Method getPrePersistMethod(Class beanClass, EntityManager entityManager)
    {
       return Entity.forClass(beanClass).getPrePersistMethod();
    }
    
-   public Method getPreUpdateMethod(Class beanClass)
+   public Method getPreUpdateMethod(Class beanClass, EntityManager entityManager)
    {
       return Entity.forClass(beanClass).getPreUpdateMethod();
    }
    
-   public Method getPreRemoveMethod(Class beanClass)
+   public Method getPreRemoveMethod(Class beanClass, EntityManager entityManager)
    {
       return Entity.forClass(beanClass).getPreRemoveMethod();
    }

Modified: trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java	2008-03-20 18:59:19 UTC (rev 7664)
+++ trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java	2008-03-20 19:06:36 UTC (rev 7665)
@@ -83,21 +83,20 @@
          String name = Seam.getComponentName(entity.getClass());
          if (name == null) name = beanClass.getName();  
          
-         // TODO - replace getXXXMethod(class) with getXXXMethod(class, entityManager)
          Method m = null;
          switch (action)
          {
             case READ:
-               m = provider.getPostLoadMethod(beanClass);
+               m = provider.getPostLoadMethod(beanClass, getEntityManager());
                break;
             case INSERT:
-               m = provider.getPrePersistMethod(beanClass);
+               m = provider.getPrePersistMethod(beanClass, getEntityManager());
                break;
             case UPDATE:
-               m = provider.getPreUpdateMethod(beanClass);
+               m = provider.getPreUpdateMethod(beanClass, getEntityManager());
                break;
             case DELETE:
-               m = provider.getPreRemoveMethod(beanClass);
+               m = provider.getPreRemoveMethod(beanClass, getEntityManager());
          }
          
          Restrict restrict = null;




More information about the seam-commits mailing list