Update of 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person
In directory james.mmbase.org:/tmp/cvs-serv19068

Modified Files:
        PersonHibernateService.java 
Log Message:
CMSC-947,Improve the newletter import/export into a generic community 
import/export,add delete groupRelations fuction


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person
See also: http://www.mmbase.org/jira/browse/CMSC-947


Index: PersonHibernateService.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person/PersonHibernateService.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- PersonHibernateService.java 15 Jul 2008 12:45:10 -0000      1.11
+++ PersonHibernateService.java 24 Jul 2008 06:30:14 -0000      1.12
@@ -165,28 +165,22 @@
           return person;
    }
    
-   @Transactional(propagation = Propagation.REQUIRED)
+  @Transactional
        public void batchClean(){
                List<Person> persons = getAllPersons();
                for (Person tempPerson : persons) {
-                       long authenticationId = 
tempPerson.getAuthenticationId();
-                       
preferenceService.batchCleanByAuthenticationId(authenticationId);
-                       
+                       if(null!=tempPerson){
+                               long authId = tempPerson.getAuthenticationId();
+                               deleteRelationRecord(authId);
+                       }
                }
-               String hqlDeletePerson = "delete Person";
-               String hqlDeleteAuthentication = "delete Authentication";
-               getSession().createQuery(hqlDeleteAuthentication)
-                            .executeUpdate();
-               getSession().createQuery(hqlDeletePerson)
-                      .executeUpdate();
        }
    
        @Transactional(propagation = Propagation.REQUIRED)
        public void deleteRelationRecord(Long id) {
-               //long id = dataPerson.getAuthenticationId();
                preferenceService.batchCleanByAuthenticationId(id);
-               authenticationService.deleteAuthentication(id);
                deletePersonByAuthenticationId(id);
+               authenticationService.deleteAuthentication(id);
        }
        
        @Transactional(propagation = Propagation.REQUIRED)
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to