mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
105524: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud) 105458: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.3) 105368: Merged DEV to V4.2-BUG-FIX (4.2.5) 105328: MNT-14021 : Request to optimize db query performance when retrieving the trashcan item - applied limit to "select_GetArchivedNodesCannedQuery" query to optimize the general performance of the trashcan git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@105587 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -37,5 +37,6 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="sortOrderAscending == true">order by childNode.id ASC</if>
|
<if test="sortOrderAscending == true">order by childNode.id ASC</if>
|
||||||
<if test="sortOrderAscending == false">order by childNode.id DESC</if>
|
<if test="sortOrderAscending == false">order by childNode.id DESC</if>
|
||||||
|
<if test="limit != 0">limit #{limit}</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@@ -74,6 +74,9 @@ public class GetArchivedNodesCannedQuery extends AbstractCannedQueryPermissions<
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int resultsRequired = parameters.getResultsRequired();
|
||||||
|
paramBean.setLimit(resultsRequired);
|
||||||
|
|
||||||
// note: refer to SQL for specific DB filtering and sorting
|
// note: refer to SQL for specific DB filtering and sorting
|
||||||
List<ArchivedNodeEntity> results = cannedQueryDAO.executeQuery(QUERY_NAMESPACE,
|
List<ArchivedNodeEntity> results = cannedQueryDAO.executeQuery(QUERY_NAMESPACE,
|
||||||
QUERY_SELECT_GET_ARCHIVED_NODES, paramBean, 0, Integer.MAX_VALUE);
|
QUERY_SELECT_GET_ARCHIVED_NODES, paramBean, 0, Integer.MAX_VALUE);
|
||||||
|
@@ -28,6 +28,8 @@ package org.alfresco.repo.node.archive;
|
|||||||
public class GetArchivedNodesCannedQueryParams extends ArchivedNodeEntity
|
public class GetArchivedNodesCannedQueryParams extends ArchivedNodeEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private int limit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parentNodeId
|
* @param parentNodeId
|
||||||
* @param assocTypeQNameId
|
* @param assocTypeQNameId
|
||||||
@@ -43,4 +45,33 @@ public class GetArchivedNodesCannedQueryParams extends ArchivedNodeEntity
|
|||||||
super(parentNodeId, nameQNameId, filter, assocTypeQNameId, sortOrderAscending,
|
super(parentNodeId, nameQNameId, filter, assocTypeQNameId, sortOrderAscending,
|
||||||
filterIgnoreCase);
|
filterIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param parentNodeId
|
||||||
|
* @param assocTypeQNameId
|
||||||
|
* @param filter
|
||||||
|
* @param filterIgnoreCase
|
||||||
|
* @param nameQNameId
|
||||||
|
* @param sortOrderAscending
|
||||||
|
* @param limit
|
||||||
|
*/
|
||||||
|
public GetArchivedNodesCannedQueryParams(Long parentNodeId, Long assocTypeQNameId,
|
||||||
|
String filter, Boolean filterIgnoreCase, Long nameQNameId, Boolean sortOrderAscending,
|
||||||
|
int limit)
|
||||||
|
{
|
||||||
|
this(parentNodeId, assocTypeQNameId, filter, filterIgnoreCase, nameQNameId,
|
||||||
|
sortOrderAscending);
|
||||||
|
this.setLimit(limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLimit()
|
||||||
|
{
|
||||||
|
return limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimit(int limit)
|
||||||
|
{
|
||||||
|
this.limit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user