protected <T,R> Expression getOrderByExpression(CriteriaQuery<R> query, Class<T> queryType, String orderByListId) {
        Attribute field = getCriteriaAttributes().get(queryType).get(orderByListId);
        assert field != null : "No Attribute found for order-by listId " + orderByListId
                + " for result type " + queryType.getSimpleName();
        Root table = getRoot(query, queryType);
        assert table != null : "Unable to find proper table (Root) instance in query for result type " + queryType.getSimpleName();

        Path orderByPath;
        if( field instanceof SingularAttribute ) {
            orderByPath = table.get((SingularAttribute) field);
        } else {
            throw new UnsupportedOperationException("Ordering by a join field is not supported!");
        }
        return orderByPath;
    }
protected < T , R > Expression getOrderByExpression ( CriteriaQuery < R > query , Class < T > queryType , String orderByListId ) { Attribute field = getCriteriaAttributes ( ) . get ( queryType ) . get ( orderByListId ) ; assert field != null : "No Attribute found for order-by listId " + orderByListId + " for result type " + queryType . getSimpleName ( ) ; Root table = getRoot ( query , queryType ) ; assert table != null : "Unable to find proper table (Root) instance in query for result type " + queryType . getSimpleName ( ) ; Path orderByPath ; if ( field instanceof SingularAttribute ) { orderByPath = table . get ( ( SingularAttribute ) field ) ; } else { throw new UnsupportedOperationException ( "Ordering by a join field is not supported!" ) ; } return orderByPath ; }
@param orderByListId
@param queryType
@param query
@return