@Test public void testOrderByPropertyAndTop() throws IOException, ODataException { createOrderByItem("DivisionCode"); when(top.getValue()).thenReturn(5); when(uriResource.getOrderByOption()).thenReturn(orderBy); when(uriResource.getTopOption()).thenReturn(top); final List<Order> act = cut.createOrderByList(joinTables, uriResource); assertEquals(2, act.size()); assertEquals(String.class, act.get(0).getExpression().getJavaType()); assertEquals(AdministrativeDivisionDescription.class, act.get(1).getExpression().getJavaType()); }
@Nonnull List<Order> createOrderByList(@Nonnull final Map<String, From<?, ?>> joinTables, @Nonnull final UriInfoResource uriResource) throws ODataApplicationException { final List<Order> result = new ArrayList<>(); try { if (uriResource.getOrderByOption() != null) { addOrderByFromUriResource(joinTables, result, uriResource.getOrderByOption()); } if (uriResource.getTopOption() != null || uriResource.getSkipOption() != null) { addOrderByPrimaryKey(result); } } catch (final ODataJPAModelException e) { throw new ODataJPAQueryException(e, BAD_REQUEST); } return result; }
JPAOrderByBuilder { @Nonnull List<Order> createOrderByList(@Nonnull final Map<String, From<?, ?>> joinTables, @Nonnull final UriInfoResource uriResource) throws ODataApplicationException { final List<Order> result = new ArrayList<>(); try { if (uriResource.getOrderByOption() != null) { addOrderByFromUriResource(joinTables, result, uriResource.getOrderByOption()); } if (uriResource.getTopOption() != null || uriResource.getSkipOption() != null) { addOrderByPrimaryKey(result); } } catch (final ODataJPAModelException e) { throw new ODataJPAQueryException(e, BAD_REQUEST); } return result; } }
JPAOrderByBuilder { @Nonnull List<Order> createOrderByList(@Nonnull final Map<String, From<?, ?>> joinTables, @Nonnull final UriInfoResource uriResource) throws ODataApplicationException { final List<Order> result = new ArrayList<>(); try { if (uriResource.getOrderByOption() != null) { addOrderByFromUriResource(joinTables, result, uriResource.getOrderByOption()); } if (uriResource.getTopOption() != null || uriResource.getSkipOption() != null) { addOrderByPrimaryKey(result); } } catch (final ODataJPAModelException e) { throw new ODataJPAQueryException(e, BAD_REQUEST); } return result; } JPAOrderByBuilder(final JPAEntityType jpaEntity, final From<?, ?> target, final CriteriaBuilder cb,
      final List<String> groups); }
JPAOrderByBuilder { @Nonnull List<Order> createOrderByList(@Nonnull final Map<String, From<?, ?>> joinTables, @Nonnull final UriInfoResource uriResource) throws ODataApplicationException { final List<Order> result = new ArrayList<>(); try { if (uriResource.getOrderByOption() != null) { addOrderByFromUriResource(joinTables, result, uriResource.getOrderByOption()); } if (uriResource.getTopOption() != null || uriResource.getSkipOption() != null) { addOrderByPrimaryKey(result); } } catch (final ODataJPAModelException e) { throw new ODataJPAQueryException(e, BAD_REQUEST); } return result; } JPAOrderByBuilder(final JPAEntityType jpaEntity, final From<?, ?> target, final CriteriaBuilder cb,
      final List<String> groups);  }
JPAOrderByBuilder { @Nonnull List<Order> createOrderByList(@Nonnull final Map<String, From<?, ?>> joinTables, @Nonnull final UriInfoResource uriResource) throws ODataApplicationException { final List<Order> result = new ArrayList<>(); try { if (uriResource.getOrderByOption() != null) { addOrderByFromUriResource(joinTables, result, uriResource.getOrderByOption()); } if (uriResource.getTopOption() != null || uriResource.getSkipOption() != null) { addOrderByPrimaryKey(result); } } catch (final ODataJPAModelException e) { throw new ODataJPAQueryException(e, BAD_REQUEST); } return result; } JPAOrderByBuilder(final JPAEntityType jpaEntity, final From<?, ?> target, final CriteriaBuilder cb,
      final List<String> groups);   }