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()); } }
ItemPath orderByPath = paging.getOrderBy(); OrderDirection direction = paging.getDirection(); if (direction != null && orderByPath != null && !orderByPath.isEmpty()) {
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; }
"Listing resource objects {} from resource, oid {}, from {} to {} ordered {} by {}.", objectClass, resourceOid, paging.getOffset(), paging.getMaxSize(), paging.getOrderBy(), paging.getDirection());
throw new UnsupportedOperationException("Ordering by more than one property is not supported: " + paging.getOrderingInstructions()); } else if (paging.getOrderingInstructions().size() == 1) { ItemPath orderBy = paging.getOrderBy(); if (CREATED_PATH.equivalent(orderBy)) { taskQuery = taskQuery.orderByTaskCreateTime();
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."); } }
ItemPath orderByPath = paging.getOrderBy(); String desc; if (orderByPath != null && !orderByPath.isEmpty()) {