Moved the tracking of newly introduced nodes into its own table. Simplifies things a bit.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3320 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-13 15:48:10 +00:00
parent fae76d7896
commit 6ac87efa5a
20 changed files with 342 additions and 129 deletions

View File

@@ -23,7 +23,6 @@ import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.SortedMap;
@@ -178,8 +177,8 @@ class SuperRepository
@SuppressWarnings("unused")
Repository rep = new RepositoryImpl(this, name);
// Special handling for repository creation.
// TODO is this needed.
rep.getRoot().setIsNew(false);
NewInRepository newInRep = AVMContext.fgInstance.fNewInRepositoryDAO.getByNode(rep.getRoot());
AVMContext.fgInstance.fNewInRepositoryDAO.delete(newInRep);
}
/**
@@ -456,12 +455,10 @@ class SuperRepository
node.setIsRoot(false);
vrDAO.delete(vr);
}
Iterator<AVMNode> iter = AVMContext.fgInstance.fAVMNodeDAO.getByRepository(rep);
while (iter.hasNext())
List<NewInRepository> newGuys = AVMContext.fgInstance.fNewInRepositoryDAO.getByRepository(rep);
for (NewInRepository newGuy : newGuys)
{
AVMNode node = iter.next();
node.setRepository(null);
AVMContext.fgInstance.fAVMNodeDAO.update(node);
AVMContext.fgInstance.fNewInRepositoryDAO.delete(newGuy);
}
AVMContext.fgInstance.fRepositoryDAO.delete(rep);
}