roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r394184 - /incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
Date Fri, 14 Apr 2006 20:17:45 GMT
Author: agilliland
Date: Fri Apr 14 13:17:43 2006
New Revision: 394184

URL: http://svn.apache.org/viewcvs?rev=394184&view=rev
Log:
remove entries and referers when deleting a weblog.


Modified:
    incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java?rev=394184&r1=394183&r2=394184&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
Fri Apr 14 13:17:43 2006
@@ -33,9 +33,10 @@
 import org.roller.pojos.PermissionsData;
 import org.roller.pojos.PingQueueEntryData;
 import org.roller.pojos.PingTargetData;
-import org.roller.pojos.RoleData;
+import org.roller.pojos.RefererData;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogCategoryData;
+import org.roller.pojos.WeblogEntryData;
 import org.roller.pojos.WebsiteData;
 
 /**
@@ -164,26 +165,24 @@
             this.strategy.remove((PingTargetData) it.next());
         }
         
-        // TODO BACKEND: backend refactoring, tidy up weblog removal
+        // remove entries
+        Criteria entryQuery = session.createCriteria(WeblogEntryData.class);
+        entryQuery.add(Expression.eq("website", website));
+        List entries = entryQuery.list();
+        for (Iterator iter = entries.iterator(); iter.hasNext();) {
+            WeblogEntryData entry = (WeblogEntryData) iter.next();
+            
+            this.strategy.remove(entry);
+        }
         
-//        // remove entries
-//        Criteria entryQuery = session.createCriteria(WeblogEntryData.class);
-//        entryQuery.add(Expression.eq("website", website));
-//        List entries = entryQuery.list();
-//        for (Iterator iter = entries.iterator(); iter.hasNext();) {
-//            WeblogEntryData entry = (WeblogEntryData) iter.next();
-//            
-//            this.strategy.remove(entry);
-//        }
-        
-//        // remove associated referers
-//        Criteria refererQuery = session.createCriteria(RefererData.class);
-//        refererQuery.add(Expression.eq("website", website));
-//        List referers = refererQuery.list();
-//        for (Iterator iter = referers.iterator(); iter.hasNext();) {
-//            RefererData referer = (RefererData) iter.next();
-//            this.strategy.remove(referer);
-//        }
+        // remove associated referers
+        Criteria refererQuery = session.createCriteria(RefererData.class);
+        refererQuery.add(Expression.eq("website", website));
+        List referers = refererQuery.list();
+        for (Iterator iter = referers.iterator(); iter.hasNext();) {
+            RefererData referer = (RefererData) iter.next();
+            this.strategy.remove(referer);
+        }
         
                 
         // remove associated pages



Mime
View raw message