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

@@ -53,26 +53,6 @@ public class AVMNodeDAOHibernate extends HibernateDaoSupport implements
getSession().save(node);
}
/**
* Get all the nodes owned by a Repository and make
* them no longer point at that Repository.
* @param rep The Repository.
*/
@SuppressWarnings("unchecked")
public void unreferenceRepository(Repository rep)
{
Session sess = getSession();
Query query = sess.createQuery("from AVMNodeImpl an where an.repository = :rep");
query.setEntity("rep", rep);
Iterator<AVMNode> iter = (Iterator<AVMNode>)query.iterate();
while (iter.hasNext())
{
AVMNode node = iter.next();
node.setRepository(null);
}
sess.flush();
}
/**
* Delete a single node.
* @param node The node to delete.
@@ -91,20 +71,6 @@ public class AVMNodeDAOHibernate extends HibernateDaoSupport implements
return AVMNodeUnwrapper.Unwrap((AVMNode)getSession().get(AVMNodeImpl.class, id));
}
/**
* Get those nodes which are new in the given repository.
* @param repo The repository.
* @return A List of AVMNodes.
*/
@SuppressWarnings("unchecked")
public List<AVMNode> getNewInRepo(Repository repo)
{
Query query =
getSession().getNamedQuery("AVMNode.ByNewInRepo");
query.setEntity("repo", repo);
return (List<AVMNode>)query.list();
}
/**
* Update a node that has been dirtied.
* @param node The node.