private void updatePagingAndSortingByOid(RootHibernateQuery hibernateQuery, ObjectPaging paging) { String rootAlias = hibernateQuery.getPrimaryEntityAlias(); if (paging.getOrderBy() != null || paging.getDirection() != null || paging.getOffset() != null) { throw new IllegalArgumentException("orderBy, direction nor offset is allowed on ObjectPaging with cookie"); } if (repoConfiguration.isUsingOracle()) { hibernateQuery.addOrdering("NLSSORT(" + rootAlias + ".oid, 'NLS_SORT=BINARY_AI')", OrderDirection.ASCENDING); } else { hibernateQuery.addOrdering(rootAlias + ".oid", OrderDirection.ASCENDING); } if (paging.getMaxSize() != null) { hibernateQuery.setMaxResults(paging.getMaxSize()); } }
OrderDirection direction = paging.getDirection(); if (direction != null && orderByPath != null && !orderByPath.isEmpty()) { if (orderByPath.size() > 1 || !orderByPath.startsWithName() && !orderByPath.startsWithIdentifier()) {
"Listing resource objects {} from resource, oid {}, from {} to {} ordered {} by {}.", objectClass, resourceOid, paging.getOffset(), paging.getMaxSize(), paging.getOrderBy(), paging.getDirection());
switch (paging.getDirection()) { case DESCENDING: taskQuery = taskQuery.desc(); break; case ASCENDING:
protected void logQuery(ObjectQuery query) { if (!LOGGER.isTraceEnabled()) { return; } if (query != null) { if (query.getPaging() == null) { LOGGER.trace("Searching objects with null paging. Processed query:\n{}", query.debugDump(1)); } else { LOGGER.trace("Searching objects from {} to {} ordered {} by {}. Processed query:\n{}", query.getPaging().getOffset(), query.getPaging().getMaxSize(), query.getPaging().getDirection(), query.getPaging().getOrderBy(), query.debugDump(1)); } } else { LOGGER.trace("Searching objects with null paging and null (processed) query."); } }
public static PagingType createPagingType(ObjectPaging paging){ if (paging == null){ return null; } PagingType pagingType = new PagingType(); pagingType .setOrderDirection(toOrderDirectionType(paging.getDirection())); pagingType.setMaxSize(paging.getMaxSize()); pagingType.setOffset(paging.getOffset()); if (paging.getOrderBy() != null) { pagingType.setOrderBy(new ItemPathType(paging.getOrderBy())); } if (paging.getGroupBy() != null) { pagingType.setGroupBy(new ItemPathType(paging.getGroupBy())); } return pagingType; }
orderByAttributeName = SchemaConstants.ICFS_NAME; isAscending = paging.getDirection() != OrderDirection.DESCENDING; desc = "(explicitly specified orderBy attribute)"; } else {