AVM DAO refactor - fix child entry name pattern match (+ missing test), also orphan reaper max limit

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16145 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-09-08 12:58:46 +00:00
parent efda84932f
commit efb73c6e4c
11 changed files with 1067 additions and 1010 deletions

View File

@@ -33,6 +33,7 @@ import org.alfresco.repo.cache.lookup.EntityLookupCache;
import org.alfresco.repo.cache.lookup.EntityLookupCache.EntityLookupCallbackDAO;
import org.alfresco.util.Pair;
import org.alfresco.util.ParameterCheck;
import org.alfresco.util.SearchLanguageConversion;
import org.springframework.dao.ConcurrencyFailureException;
/**
@@ -143,9 +144,20 @@ public abstract class AbstractAVMNodeLinksDAOImpl implements AVMNodeLinksDAO
/**
* {@inheritDoc}
*/
public List<AVMChildEntryEntity> getChildEntriesByParent(long parentNodeId)
public List<AVMChildEntryEntity> getChildEntriesByParent(long parentNodeId, String childNamePattern)
{
List<AVMChildEntryEntity> result = getChildEntryEntitiesByParent(parentNodeId);
List<AVMChildEntryEntity> result = null;
if ((childNamePattern == null) || (childNamePattern.length() == 0))
{
result = getChildEntryEntitiesByParent(parentNodeId);
}
else
{
String pattern = SearchLanguageConversion.convert(SearchLanguageConversion.DEF_LUCENE, SearchLanguageConversion.DEF_SQL_LIKE, childNamePattern);
result = getChildEntryEntitiesByParent(parentNodeId, pattern);
}
if (result == null)
{
result = new ArrayList<AVMChildEntryEntity>(0);
@@ -214,7 +226,7 @@ public abstract class AbstractAVMNodeLinksDAOImpl implements AVMNodeLinksDAO
*/
public void deleteChildEntriesByParent(long parentNodeId)
{
List<AVMChildEntryEntity> ceEntities = getChildEntriesByParent(parentNodeId);
List<AVMChildEntryEntity> ceEntities = getChildEntriesByParent(parentNodeId, null);
if (ceEntities.size() == 0)
{
return;
@@ -353,6 +365,7 @@ public abstract class AbstractAVMNodeLinksDAOImpl implements AVMNodeLinksDAO
}
protected abstract List<AVMChildEntryEntity> getChildEntryEntitiesByParent(long parentNodeId);
protected abstract List<AVMChildEntryEntity> getChildEntryEntitiesByParent(long parentNodeId, String childNamePattern);
protected abstract List<AVMChildEntryEntity> getChildEntryEntitiesByChild(long childNodeId);
protected abstract AVMChildEntryEntity getChildEntryEntity(long parentNodeId, String name);