diff --git a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml index e1b888d240..7cef78dd61 100644 --- a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml +++ b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml @@ -1,988 +1,1004 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into avm_stores (next_version_id, name, vers, current_root_id, acl_id) - values (#version#, #name#, 0, null, null) - - - - insert into avm_nodes (class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length) - values (#classType#, #deletedType#, #version#, 0, #storeNewId#, #aclId#, #guid#, #owner#, #creator#, #createdDate#, #modifier#, #modifiedDate#, #accessDate#, #isRoot#, #layerId#, #indirection#, #indirectionVersion#, #primaryIndirection#, #opacity#, #contentUrl#, #mimetype#, #encoding#, #length#) - - - - insert into avm_version_roots (avm_store_id, root_id, version_id, creator, create_date, tag, description) - values (#storeId#, #rootNodeId#, #version#, #creator#, #createdDate#, #tag#, #description#) - - - - insert into avm_store_properties (avm_store_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value) - values (#avmStoreId#, #qnameId#, #actualType#, #persistedType#, #isMultiValued#, #booleanValue#, #longValue#, #floatValue#, #doubleValue#, #stringValue#, #serializable#) - - - - - - - - - insert into avm_aspects (node_id, qname_id) - values (#nodeId#, #qnameId#) - - - - insert into avm_child_entries (parent_id, name, child_id) - values (#parentNodeId#, #name#, #childNodeId#) - - - - insert into avm_history_links (ancestor, descendent) - values (#ancestorNodeId#, #descendentNodeId#) - - - - insert into avm_merge_links (mfrom, mto) - values (#mergeFromNodeId#, #mergeToNodeId#) - - - - insert into avm_version_layered_node_entry (version_root_id, md5sum, path) - values (#versionRootId#, #md5sum#, #path#) - - - - insert into avm_node_properties (node_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value) - values (#nodeId#, #qnameId#, #actualType#, #persistedType#, #isMultiValued#, #booleanValue#, #longValue#, #floatValue#, #doubleValue#, #stringValue#, #serializable#) - - - - - - - - - - - - - - - - - - - - - update - avm_stores - set - next_version_id = #nextVersion#, - name = #name#, - current_root_id = #rootNodeId#, - acl_id = #aclId#, - vers = (#vers# + 1) - where - id = #id# and - vers = #vers# - - - - - delete - from - avm_stores - where - id = ? - - - - - - - - - - - - - - - - - update - avm_store_properties - set - actual_type_n = #actualType#, - persisted_type_n = #persistedType#, - multi_valued = #isMultiValued#, - boolean_value = #booleanValue#, - long_value = #longValue#, - float_value = #floatValue#, - double_value = #doubleValue#, - string_value = #stringValue#, - serializable_value = #serializable# - where - id = #id# - - - - delete - from - avm_store_properties - where - avm_store_id = #avmStoreId# and - qname_id = #qnameId# - - - - delete - from - avm_store_properties - where - avm_store_id = ? - - - - - - - - - - - - - - - - - - - - - - - - update - avm_nodes - set - store_new_id = null - where - store_new_id = ? - - - - - update - avm_nodes - set - store_new_id = #storeNewId#, - acl_id = #aclId#, - layer_id = #layerId#, - version_id = #version#, - class_type = #classType#, - deletedType = #deletedType#, - owner = #owner#, - lastModifier = #modifier#, - modDate = #modifiedDate#, - accessDate = #accessDate#, - is_root = #isRoot#, - lastModifier = #modifier#, - indirection = #indirection#, - indirection_version = #indirectionVersion#, - primary_indirection = #primaryIndirection#, - opacity = #opacity#, - content_url = #contentUrl#, - mime_type = #mimetype#, - encoding = #encoding#, - length = #length#, - guid = #guid#, - vers = (#vers# + 1) - where - id = #id# and - vers = #vers# - - - - update - avm_nodes - set - modDate = #modifiedDate#, - guid = #guid#, - vers = (#vers# + 1) - where - id = #id# and - vers = #vers# - - - - update - avm_nodes - set - modDate = #modifiedDate#, - content_url = #contentUrl#, - mime_type = #mimetype#, - encoding = #encoding#, - length = #length#, - vers = (#vers# + 1) - where - id = #id# and - vers = #vers# - - - - delete - from - avm_nodes - where - id = ? - - - - - - - - - - - - - update - avm_node_properties - set - actual_type_n = #actualType#, - persisted_type_n = #persistedType#, - multi_valued = #isMultiValued#, - boolean_value = #booleanValue#, - long_value = #longValue#, - float_value = #floatValue#, - double_value = #doubleValue#, - string_value = #stringValue#, - serializable_value = #serializable# - where - node_id = #nodeId# and - qname_id = #qnameId# - - - - delete - from - avm_node_properties - where - node_id = #nodeId# and - qname_id = #qnameId# - - - - delete - from - avm_node_properties - where - node_id = ? - - - - - - - - - - - - - - - - - - - - - - - - - - - update - avm_version_roots - set - tag = #tag#, - description = #description# - where - id = #id# - - - - delete - from - avm_version_roots - where - id = ? - - - - - - - - - - delete - from - avm_version_layered_node_entry - where - version_root_id = ? - - - - - - - - - - - - delete - from - avm_aspects - where - node_id = #nodeId# and - qname_id = #qnameId# - - - - delete - from - avm_aspects - where - node_id = ? - - - - - - - - - - - - - - - - - - - - - - - - delete - from - avm_child_entries - where - parent_id = #parentNodeId# and - name = #name# and - child_id = #childNodeId# - - - - - delete - from - avm_child_entries - where - parent_id = #parentNodeId# and - name = #name# - - - - - delete - from - avm_child_entries - where - parent_id = #parentNodeId# and - child_id = #childNodeId# - - - - - delete - from - avm_child_entries - where - parent_id = ? - - - - - - - - - - - - - - delete - from - avm_merge_links - where - mfrom = #mergeFromNodeId# and - mto = #mergeToNodeId# - - - - - - - - - - - - - - delete - from - avm_history_links - where - ancestor = #ancestorNodeId# and - descendent = #descendentNodeId# - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into avm_stores (next_version_id, name, vers, current_root_id, acl_id) + values (#version#, #name#, 0, null, null) + + + + insert into avm_nodes (class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length) + values (#classType#, #deletedType#, #version#, 0, #storeNewId#, #aclId#, #guid#, #owner#, #creator#, #createdDate#, #modifier#, #modifiedDate#, #accessDate#, #isRoot#, #layerId#, #indirection#, #indirectionVersion#, #primaryIndirection#, #opacity#, #contentUrl#, #mimetype#, #encoding#, #length#) + + + + insert into avm_version_roots (avm_store_id, root_id, version_id, creator, create_date, tag, description) + values (#storeId#, #rootNodeId#, #version#, #creator#, #createdDate#, #tag#, #description#) + + + + insert into avm_store_properties (avm_store_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value) + values (#avmStoreId#, #qnameId#, #actualType#, #persistedType#, #isMultiValued#, #booleanValue#, #longValue#, #floatValue#, #doubleValue#, #stringValue#, #serializable#) + + + + + + + + + insert into avm_aspects (node_id, qname_id) + values (#nodeId#, #qnameId#) + + + + insert into avm_child_entries (parent_id, name, child_id) + values (#parentNodeId#, #name#, #childNodeId#) + + + + insert into avm_history_links (ancestor, descendent) + values (#ancestorNodeId#, #descendentNodeId#) + + + + insert into avm_merge_links (mfrom, mto) + values (#mergeFromNodeId#, #mergeToNodeId#) + + + + insert into avm_version_layered_node_entry (version_root_id, md5sum, path) + values (#versionRootId#, #md5sum#, #path#) + + + + insert into avm_node_properties (node_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value) + values (#nodeId#, #qnameId#, #actualType#, #persistedType#, #isMultiValued#, #booleanValue#, #longValue#, #floatValue#, #doubleValue#, #stringValue#, #serializable#) + + + + + + + + + + + + + + + + + + + + + update + avm_stores + set + next_version_id = #nextVersion#, + name = #name#, + current_root_id = #rootNodeId#, + acl_id = #aclId#, + vers = (#vers# + 1) + where + id = #id# and + vers = #vers# + + + + + delete + from + avm_stores + where + id = ? + + + + + + + + + + + + + + + + + update + avm_store_properties + set + actual_type_n = #actualType#, + persisted_type_n = #persistedType#, + multi_valued = #isMultiValued#, + boolean_value = #booleanValue#, + long_value = #longValue#, + float_value = #floatValue#, + double_value = #doubleValue#, + string_value = #stringValue#, + serializable_value = #serializable# + where + id = #id# + + + + delete + from + avm_store_properties + where + avm_store_id = #avmStoreId# and + qname_id = #qnameId# + + + + delete + from + avm_store_properties + where + avm_store_id = ? + + + + + + + + + + + + + + + + + + + + + + + + update + avm_nodes + set + store_new_id = null + where + store_new_id = ? + + + + + update + avm_nodes + set + store_new_id = #storeNewId#, + acl_id = #aclId#, + layer_id = #layerId#, + version_id = #version#, + class_type = #classType#, + deletedType = #deletedType#, + owner = #owner#, + lastModifier = #modifier#, + modDate = #modifiedDate#, + accessDate = #accessDate#, + is_root = #isRoot#, + lastModifier = #modifier#, + indirection = #indirection#, + indirection_version = #indirectionVersion#, + primary_indirection = #primaryIndirection#, + opacity = #opacity#, + content_url = #contentUrl#, + mime_type = #mimetype#, + encoding = #encoding#, + length = #length#, + guid = #guid#, + vers = (#vers# + 1) + where + id = #id# and + vers = #vers# + + + + update + avm_nodes + set + modDate = #modifiedDate#, + guid = #guid#, + vers = (#vers# + 1) + where + id = #id# and + vers = #vers# + + + + update + avm_nodes + set + modDate = #modifiedDate#, + content_url = #contentUrl#, + mime_type = #mimetype#, + encoding = #encoding#, + length = #length#, + vers = (#vers# + 1) + where + id = #id# and + vers = #vers# + + + + delete + from + avm_nodes + where + id = ? + + + + + + + + + + + + + update + avm_node_properties + set + actual_type_n = #actualType#, + persisted_type_n = #persistedType#, + multi_valued = #isMultiValued#, + boolean_value = #booleanValue#, + long_value = #longValue#, + float_value = #floatValue#, + double_value = #doubleValue#, + string_value = #stringValue#, + serializable_value = #serializable# + where + node_id = #nodeId# and + qname_id = #qnameId# + + + + delete + from + avm_node_properties + where + node_id = #nodeId# and + qname_id = #qnameId# + + + + delete + from + avm_node_properties + where + node_id = ? + + + + + + + + + + + + + + + + + + + + + + + + + + + update + avm_version_roots + set + tag = #tag#, + description = #description# + where + id = #id# + + + + delete + from + avm_version_roots + where + id = ? + + + + + + + + + + delete + from + avm_version_layered_node_entry + where + version_root_id = ? + + + + + + + + + + + + delete + from + avm_aspects + where + node_id = #nodeId# and + qname_id = #qnameId# + + + + delete + from + avm_aspects + where + node_id = ? + + + + + + + + + + + + + + + + + + + + + + + + + + + delete + from + avm_child_entries + where + parent_id = #parentNodeId# and + name = #name# and + child_id = #childNodeId# + + + + + delete + from + avm_child_entries + where + parent_id = #parentNodeId# and + name = #name# + + + + + delete + from + avm_child_entries + where + parent_id = #parentNodeId# and + child_id = #childNodeId# + + + + + delete + from + avm_child_entries + where + parent_id = ? + + + + + + + + + + + + + + delete + from + avm_merge_links + where + mfrom = #mergeFromNodeId# and + mto = #mergeToNodeId# + + + + + + + + + + + + + + delete + from + avm_history_links + where + ancestor = #ancestorNodeId# and + descendent = #descendentNodeId# + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/avm/AVMChildNamePatternMatchPerformanceTest.java b/source/java/org/alfresco/repo/avm/AVMChildNamePatternMatchPerformanceTest.java index c3e7dd23ca..02264278fa 100644 --- a/source/java/org/alfresco/repo/avm/AVMChildNamePatternMatchPerformanceTest.java +++ b/source/java/org/alfresco/repo/avm/AVMChildNamePatternMatchPerformanceTest.java @@ -1,14 +1,33 @@ +/* + * Copyright (C) 2005-2009 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ package org.alfresco.repo.avm; -import java.util.List; import java.util.SortedMap; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.service.cmr.avm.AVMNodeDescriptor; -import org.alfresco.service.cmr.avmsync.AVMDifference; -import org.alfresco.service.cmr.repository.StoreRef; -import org.alfresco.service.cmr.search.ResultSet; -import org.alfresco.service.cmr.search.SearchService; import org.alfresco.util.GUID; public class AVMChildNamePatternMatchPerformanceTest extends AVMServiceTestBase diff --git a/source/java/org/alfresco/repo/avm/AVMTestSuite.java b/source/java/org/alfresco/repo/avm/AVMTestSuite.java index fac8913bc8..1cf895abdf 100644 --- a/source/java/org/alfresco/repo/avm/AVMTestSuite.java +++ b/source/java/org/alfresco/repo/avm/AVMTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Alfresco Software Limited. + * Copyright (C) 2005-2009 Alfresco Software Limited. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -40,7 +40,7 @@ public class AVMTestSuite extends TestSuite public static Test suite() { TestSuite suite = new TestSuite(); - + suite.addTestSuite(AVMNodeConverterTest.class); suite.addTestSuite(AVMExpiredContentTest.class); suite.addTestSuite(FileNameValidatorTest.class); @@ -61,6 +61,7 @@ public class AVMTestSuite extends TestSuite suite.addTestSuite(PurgeTestP.class); suite.addTestSuite(SimultaneousLoadTest.class); suite.addTestSuite(AVMDiffPerformanceTest.class); + suite.addTestSuite(AVMChildNamePatternMatchPerformanceTest.class); return suite; } diff --git a/source/java/org/alfresco/repo/avm/ibatis/AVMNodeDAOIbatis.java b/source/java/org/alfresco/repo/avm/ibatis/AVMNodeDAOIbatis.java index 0bafedea0d..bfa015150f 100644 --- a/source/java/org/alfresco/repo/avm/ibatis/AVMNodeDAOIbatis.java +++ b/source/java/org/alfresco/repo/avm/ibatis/AVMNodeDAOIbatis.java @@ -244,8 +244,7 @@ class AVMNodeDAOIbatis extends HibernateDaoSupport implements AVMNodeDAO */ public List getOrphans(int batchSize) { - // TODO - limit to batch size - List nodeEntities = AVMDAOs.Instance().newAVMNodeDAO.getNodeOrphans(); + List nodeEntities = AVMDAOs.Instance().newAVMNodeDAO.getNodeOrphans(batchSize); if (nodeEntities == null) { diff --git a/source/java/org/alfresco/repo/avm/ibatis/ChildEntryDAOIbatis.java b/source/java/org/alfresco/repo/avm/ibatis/ChildEntryDAOIbatis.java index 156f19eeb1..d68064746c 100644 --- a/source/java/org/alfresco/repo/avm/ibatis/ChildEntryDAOIbatis.java +++ b/source/java/org/alfresco/repo/avm/ibatis/ChildEntryDAOIbatis.java @@ -65,9 +65,7 @@ class ChildEntryDAOIbatis implements ChildEntryDAO */ public List getByParent(DirectoryNode parent, String childNamePattern) { - // TODO - add option for childNamePattern - - List childEntryEntities = AVMDAOs.Instance().newAVMNodeLinksDAO.getChildEntriesByParent(parent.getId()); + List childEntryEntities = AVMDAOs.Instance().newAVMNodeLinksDAO.getChildEntriesByParent(parent.getId(), childNamePattern); List result = new ArrayList(childEntryEntities.size()); for (AVMChildEntryEntity childEntryEntity : childEntryEntities) diff --git a/source/java/org/alfresco/repo/domain/avm/AVMNodeDAO.java b/source/java/org/alfresco/repo/domain/avm/AVMNodeDAO.java index 96a09ca425..56074bbfe1 100644 --- a/source/java/org/alfresco/repo/domain/avm/AVMNodeDAO.java +++ b/source/java/org/alfresco/repo/domain/avm/AVMNodeDAO.java @@ -65,7 +65,7 @@ public interface AVMNodeDAO public List getLayeredNodesNewInStoreIDs(long storeId); - public List getNodeOrphans(); + public List getNodeOrphans(int maxSize); public void updateNodesClearNewInStore(long storeId); diff --git a/source/java/org/alfresco/repo/domain/avm/AVMNodeLinksDAO.java b/source/java/org/alfresco/repo/domain/avm/AVMNodeLinksDAO.java index 492066430a..a80d85c623 100644 --- a/source/java/org/alfresco/repo/domain/avm/AVMNodeLinksDAO.java +++ b/source/java/org/alfresco/repo/domain/avm/AVMNodeLinksDAO.java @@ -48,9 +48,9 @@ public interface AVMNodeLinksDAO public void createChildEntry(long parentNodeId, String name, long childNodeId); /** - * Get all the children of a given parent + * Get all the children of a given parent (with optional child name pattern) */ - public List getChildEntriesByParent(long parentNodeId); + public List getChildEntriesByParent(long parentNodeId, String childNamePattern); /** * Get all the ChildEntries corresponding to the given child diff --git a/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeDAOImpl.java b/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeDAOImpl.java index 5772a8c033..7b0cc85b90 100644 --- a/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeDAOImpl.java +++ b/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeDAOImpl.java @@ -266,9 +266,9 @@ public abstract class AbstractAVMNodeDAOImpl implements AVMNodeDAO /** * {@inheritDoc} */ - public List getNodeOrphans() + public List getNodeOrphans(int maxSize) { - return getNodeEntityOrphans(); + return getNodeEntityOrphans(maxSize); } /** @@ -399,7 +399,7 @@ public abstract class AbstractAVMNodeDAOImpl implements AVMNodeDAO protected abstract List getNodeEntitiesNewInStore(long storeId); protected abstract List getLayeredNodeEntitiesNewInStore(long storeId); protected abstract List getLayeredNodeEntityIdsNewInStore(long storeId); - protected abstract List getNodeEntityOrphans(); + protected abstract List getNodeEntityOrphans(int maxSize); protected abstract List getAllLayeredDirectoryNodeEntities(); protected abstract List getAllLayeredFileNodeEntities(); protected abstract List getAVMNodeEntityIdsByAclId(long aclId); diff --git a/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeLinksDAOImpl.java b/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeLinksDAOImpl.java index 18084ce18d..626560eda2 100644 --- a/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeLinksDAOImpl.java +++ b/source/java/org/alfresco/repo/domain/avm/AbstractAVMNodeLinksDAOImpl.java @@ -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 getChildEntriesByParent(long parentNodeId) + public List getChildEntriesByParent(long parentNodeId, String childNamePattern) { - List result = getChildEntryEntitiesByParent(parentNodeId); + List 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(0); @@ -214,7 +226,7 @@ public abstract class AbstractAVMNodeLinksDAOImpl implements AVMNodeLinksDAO */ public void deleteChildEntriesByParent(long parentNodeId) { - List ceEntities = getChildEntriesByParent(parentNodeId); + List ceEntities = getChildEntriesByParent(parentNodeId, null); if (ceEntities.size() == 0) { return; @@ -353,6 +365,7 @@ public abstract class AbstractAVMNodeLinksDAOImpl implements AVMNodeLinksDAO } protected abstract List getChildEntryEntitiesByParent(long parentNodeId); + protected abstract List getChildEntryEntitiesByParent(long parentNodeId, String childNamePattern); protected abstract List getChildEntryEntitiesByChild(long childNodeId); protected abstract AVMChildEntryEntity getChildEntryEntity(long parentNodeId, String name); diff --git a/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeDAOImpl.java b/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeDAOImpl.java index cab5d9220b..89208622ea 100644 --- a/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeDAOImpl.java +++ b/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeDAOImpl.java @@ -166,9 +166,9 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl @SuppressWarnings("unchecked") @Override - protected List getNodeEntityOrphans() + protected List getNodeEntityOrphans(int maxSize) { - return (List) template.queryForList(SELECT_AVM_NODES_ORPHANS); + return (List) template.queryForList(SELECT_AVM_NODES_ORPHANS, 0, maxSize); } @SuppressWarnings("unchecked") diff --git a/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeLinksDAOImpl.java b/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeLinksDAOImpl.java index 44ebe30944..7aea2b8244 100644 --- a/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeLinksDAOImpl.java +++ b/source/java/org/alfresco/repo/domain/avm/ibatis/AVMNodeLinksDAOImpl.java @@ -46,6 +46,7 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl private static final String SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_NAME ="alfresco.avm.select_AVMChildEntryByParentAndName"; // parent + name private static final String SELECT_AVM_NODE_CHILD_ENTRY_BY_PARENT_AND_CHILD ="alfresco.avm.select_AVMChildEntryByParentAndChild"; // parent + child private static final String SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT ="alfresco.avm.select_AVMNodeChildEntriesByParent"; // parent + private static final String SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT_AND_NAME_PATTERN ="alfresco.avm.select_AVMNodeChildEntriesByParentAndNamePattern"; // parent + name pattern private static final String SELECT_AVM_NODE_CHILD_ENTRIES_BY_CHILD ="alfresco.avm.select_AVMNodeChildEntriesByChild"; // child private static final String INSERT_AVM_NODE_CHILD_ENTRY ="alfresco.avm.insert_AVMChildEntry"; // parent + name + child @@ -103,6 +104,16 @@ public class AVMNodeLinksDAOImpl extends AbstractAVMNodeLinksDAOImpl return (List) template.queryForList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT, params); } + @SuppressWarnings("unchecked") + @Override + protected List getChildEntryEntitiesByParent(long parentNodeId, String childNamePattern) + { + Map params = new HashMap(1); + params.put("id", parentNodeId); + params.put("pattern", childNamePattern); + return (List) template.queryForList(SELECT_AVM_NODE_CHILD_ENTRIES_BY_PARENT_AND_NAME_PATTERN, params); + } + @SuppressWarnings("unchecked") @Override protected List getChildEntryEntitiesByChild(long childNodeId)