Update of
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/services/community/person
In directory
james.mmbase.org:/tmp/cvs-serv32203/community/src/java/com/finalist/cmsc/services/community/person
Modified Files:
Tag: b1_4
PersonHibernateService.java
Log Message:
CMSC-617 Personal Pages module
Backport to 1.4
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-617
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.2
retrieving revision 1.2.2.1
diff -u -b -r1.2 -r1.2.2.1
--- PersonHibernateService.java 29 Jan 2008 09:59:40 -0000 1.2
+++ PersonHibernateService.java 25 Feb 2008 16:26:17 -0000 1.2.2.1
@@ -1,16 +1,18 @@
/*
-This software is OSI Certified Open Source Software.
-OSI Certified is a certification mark of the Open Source Initiative.
+ This software is OSI Certified Open Source Software.
+ OSI Certified is a certification mark of the Open Source Initiative.
-The license (Mozilla version 1.0) can be read at the MMBase site.
-See http://www.MMBase.org/license
+ The license (Mozilla version 1.0) can be read at the MMBase site.
+ See http://www.MMBase.org/license
-*/
+ */
package com.finalist.cmsc.services.community.person;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Required;
@@ -24,6 +26,8 @@
*/
public class PersonHibernateService extends HibernateService implements
PersonService {
+ private static Log log =
LogFactory.getLog(PersonHibernateService.class);
+
private AuthenticationService authenticationService;
/** [EMAIL PROTECTED] */
@@ -49,17 +53,20 @@
/** [EMAIL PROTECTED] */
@Transactional
public void deletePersonByUserId(String userId) {
+ if (userId != null) {
Person person = findPersonByUserId(userId);
+ if (person != null) {
getSession().delete(person);
}
+ }
+ }
private Person findPersonByUserId(String userId) {
Long authenticationId =
authenticationService.getAuthenticationIdForUserId(userId);
Person person = null;
if (authenticationId != null) {
- Criteria criteria = getSession()
- .createCriteria(Person.class)
- .add(Restrictions.eq("authenticationId",
authenticationId));
+ Criteria criteria =
getSession().createCriteria(Person.class).add(
+ Restrictions.eq("authenticationId",
authenticationId));
person = findPersonByCriteria(criteria);
}
return person;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs