mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-7167 (RINF 11) - CQ
- fix executeQuery for nested result map (need to allow unbounded - see comment) - also: trivial fix to GetAuthorities CQ (remove @SuppressWarnings) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28727 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -130,15 +130,29 @@ public class CannedQueryDAOImpl extends AbstractCannedQueryDAOImpl
|
|||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Query result offset must be zero or greater.");
|
throw new IllegalArgumentException("Query result offset must be zero or greater.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO MyBatis workaround - temporarily support unlimited for nested result maps (see also below)
|
||||||
|
/*
|
||||||
if (limit <= 0 || limit == Integer.MAX_VALUE)
|
if (limit <= 0 || limit == Integer.MAX_VALUE)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Query results must be constrained by a limit.");
|
throw new IllegalArgumentException("Query results must be constrained by a limit.");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
String query = makeQueryName(sqlNamespace, queryName);
|
String query = makeQueryName(sqlNamespace, queryName);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RowBounds bounds = new RowBounds(offset, limit);
|
if ((offset == 0) && (limit == Integer.MAX_VALUE))
|
||||||
return (List<R>) template.selectList(query, parameterObj, bounds);
|
{
|
||||||
|
// TODO MyBatis workaround - temporarily support unlimited for nested result maps (see also above)
|
||||||
|
// http://code.google.com/p/mybatis/issues/detail?id=129
|
||||||
|
return (List<R>) template.selectList(query, parameterObj);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RowBounds bounds = new RowBounds(offset, limit);
|
||||||
|
return (List<R>) template.selectList(query, parameterObj, bounds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (ClassCastException e)
|
catch (ClassCastException e)
|
||||||
{
|
{
|
||||||
|
@@ -161,7 +161,7 @@ public class GetAuthoritiesCannedQuery extends AbstractCannedQueryPermissions<Au
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked"})
|
||||||
protected List<AuthorityInfo> applyPostQuerySorting(List<AuthorityInfo> results, CannedQuerySortDetails sortDetails)
|
protected List<AuthorityInfo> applyPostQuerySorting(List<AuthorityInfo> results, CannedQuerySortDetails sortDetails)
|
||||||
{
|
{
|
||||||
final List<Pair<Object, SortOrder>> sortPairs = (List)sortDetails.getSortPairs();
|
final List<Pair<Object, SortOrder>> sortPairs = (List)sortDetails.getSortPairs();
|
||||||
|
Reference in New Issue
Block a user