/** * Convert the value into an offset into the table for this browse * * @param value value * @return the focus value to use * @throws BrowseException if browse error */ private int getOffsetForDistinctValue(String value) throws BrowseException { if (!browseIndex.isMetadataIndex()) { throw new IllegalArgumentException("getOffsetForDistinctValue called when not a metadata index"); } // now get the DAO to do the query for us, returning the highest // string value in the given column in the given table for the // item (I think) return dao.doDistinctOffsetQuery("sort_value", value, scope.isAscending()); }
/** * Convert the value into an offset into the table for this browse * * @param value value * @return the focus value to use * @throws BrowseException if browse error */ private int getOffsetForValue(String value) throws BrowseException { // we need to make sure that we select from the correct column. If the sort option // is the 0th option then we use sort_value, but if it is one of the others we have // to select from that column instead. Otherwise, we end up missing the focus value // to do comparisons in other columns. The use of the focus value needs to be consistent // across the browse SortOption so = scope.getSortOption(); if (so == null || so.getNumber() == 0) { if (browseIndex.getSortOption() != null) { so = browseIndex.getSortOption(); } } String col = "sort_1"; if (so.getNumber() > 0) { col = "sort_" + Integer.toString(so.getNumber()); } // now get the DAO to do the query for us, returning the highest // string value in the given column in the given table for the // item (I think) return dao.doOffsetQuery(col, value, scope.isAscending()); }
dao.setAscending(scope.isAscending()); browseInfo.setAscending(scope.isAscending());
dao.setAscending(scope.isAscending()); browseInfo.setAscending(scope.isAscending());
dao.setAscending(scope.isAscending()); browseInfo.setAscending(scope.isAscending());