mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added missing callbacks to AVMNodeService. This makes things slow.
Have to do something about that. Added getPaths call to AVMService. Retrieves all possible paths to a node. Need to do timing tests. I believe, the 6th version of a Pair template class. This one's public and perhaps when we have time we could use it in place of all the inner class implementations. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3964 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,6 +19,7 @@ package org.alfresco.repo.avm.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.avm.AVMNode;
|
||||
import org.alfresco.repo.avm.AVMStore;
|
||||
import org.alfresco.repo.avm.AVMStoreDAO;
|
||||
import org.alfresco.repo.avm.AVMStoreImpl;
|
||||
@@ -78,7 +79,20 @@ class AVMStoreDAOHibernate extends HibernateDaoSupport implements
|
||||
{
|
||||
return (AVMStore)getSession().get(AVMStoreImpl.class, name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the AVM Store that has the given root as HEAD.
|
||||
* @param root The root to query.
|
||||
* @return The matching store or null.
|
||||
*/
|
||||
public AVMStore getByRoot(AVMNode root)
|
||||
{
|
||||
Query query = getSession().createQuery("from AVMStoreImpl st " +
|
||||
"where st.root = :root");
|
||||
query.setEntity("root", root);
|
||||
return (AVMStore)query.uniqueResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given AVMStore record.
|
||||
* @param store The dirty AVMStore.
|
||||
|
@@ -92,6 +92,20 @@ class ChildEntryDAOHibernate extends HibernateDaoSupport implements
|
||||
return (ChildEntry)query.uniqueResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the ChildEntries corresponding to the given child.
|
||||
* @param child The child for which to look up entries.
|
||||
* @return The matching entries.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ChildEntry> getByChild(AVMNode child)
|
||||
{
|
||||
Query query = getSession().createQuery("from ChildEntryImpl ce " +
|
||||
"where ce.child = :child");
|
||||
query.setEntity("child", child);
|
||||
return (List<ChildEntry>)query.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a dirty ChildEntry.
|
||||
* @param child The dirty entry.
|
||||
|
@@ -20,6 +20,7 @@ package org.alfresco.repo.avm.hibernate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.avm.AVMNode;
|
||||
import org.alfresco.repo.avm.AVMStore;
|
||||
import org.alfresco.repo.avm.VersionRoot;
|
||||
import org.alfresco.repo.avm.VersionRootDAO;
|
||||
@@ -128,7 +129,20 @@ class VersionRootDAOHibernate extends HibernateDaoSupport implements
|
||||
query.setInteger("version", id);
|
||||
return (VersionRoot)query.uniqueResult();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get one from its root.
|
||||
* @param root The root to match.
|
||||
* @return The version root or null.
|
||||
*/
|
||||
public VersionRoot getByRoot(AVMNode root)
|
||||
{
|
||||
Query query = getSession().createQuery("from VersionRootImpl vr " +
|
||||
"where vr.root = :root");
|
||||
query.setEntity("root", root);
|
||||
return (VersionRoot)query.uniqueResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the highest numbered version in a repository.
|
||||
* @param rep The repository.
|
||||
|
Reference in New Issue
Block a user