Examples of OrderByExpression


Examples of com.salesforce.phoenix.expression.OrderByExpression

            this.services = services;
        }
        @Override
        public PeekingResultIterator newIterator(ResultIterator scanner) throws SQLException {
            Expression expression = RowKeyExpression.INSTANCE;
            OrderByExpression orderByExpression = new OrderByExpression(expression, false, true);
            int threshold = services.getProps().getInt(QueryServices.SPOOL_THRESHOLD_BYTES_ATTRIB, QueryServicesOptions.DEFAULT_SPOOL_THRESHOLD_BYTES);
            return new OrderedResultIterator(scanner, Collections.<OrderByExpression>singletonList(orderByExpression), threshold);
        }
View Full Code Here

Examples of com.salesforce.phoenix.expression.OrderByExpression

            int limit = WritableUtils.readVInt(input);
            int estimatedRowSize = WritableUtils.readVInt(input);
            int size = WritableUtils.readVInt(input);
            List<OrderByExpression> orderByExpressions = Lists.newArrayListWithExpectedSize(size);          
            for (int i = 0; i < size; i++) {
                OrderByExpression orderByExpression = new OrderByExpression();
                orderByExpression.readFields(input);
                orderByExpressions.add(orderByExpression);
            }
            ResultIterator inner = new RegionScannerResultIterator(s);
            return new OrderedResultIterator(inner, orderByExpressions, thresholdBytes, limit >= 0 ? limit : null, estimatedRowSize);
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

    final ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.OK, null, null);

    UriInfo uriInfo = mock(UriInfo.class);
    final FilterExpression filter = UriParser.parseFilter(null, null, "true");
    when(uriInfo.getFilter()).thenReturn(filter);
    final OrderByExpression orderBy = UriParser.parseOrderBy(null, null, "true");
    when(uriInfo.getOrderBy()).thenReturn(orderBy);
    List<ArrayList<NavigationPropertySegment>> expand = new ArrayList<ArrayList<NavigationPropertySegment>>();
    NavigationPropertySegment segment = mock(NavigationPropertySegment.class);
    EdmNavigationProperty navigationProperty = mock(EdmNavigationProperty.class);
    when(navigationProperty.getName()).thenReturn("nav");
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

   * @throws ODataJPARuntimeException
   */

  @Test
  public void testBuildSimpleQuery() throws EdmException, ODataJPARuntimeException {
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
    JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, null);
    jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl);

    assertEquals("SELECT E1 FROM SalesOrderHeader E1", jpqlSelectStatementBuilder.build().toString());
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

    assertEquals("SELECT E1 FROM SalesOrderHeader E1", jpqlSelectStatementBuilder.build().toString());
  }

  @Test
  public void testBuildQueryWithOrderBy() throws EdmException, ODataJPARuntimeException {
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);

    JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, null);
    HashMap<String, String> orderByCollection = new HashMap<String, String>();
    orderByCollection.put("E1.soID", "ASC");
    orderByCollection.put("E1.buyerId", "DESC");
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

        jpqlSelectStatementBuilder.build().toString());
  }

  @Test
  public void testBuildQueryWithFilter() throws EdmException, ODataJPARuntimeException {
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
    FilterExpression filterExpression = null;// getFilterExpressionMockedObj();
    JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, filterExpression);
    jpqlSelectContextImpl.setWhereExpression("E1.soID >= 1234");

    jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl);
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

      orderList.add(order);

    } while (++i < 2);

    OrderByExpression orderBy = EasyMock.createMock(OrderByExpression.class);
    EasyMock.expect(orderBy.getOrders()).andStubReturn(orderList);
    EasyMock.replay(orderBy);

    try {
      i = 0;
      List<SelectItem> selectItemList = new ArrayList<SelectItem>(2);
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

    EdmEntitySet edmEntitySet = EasyMock.createMock(EdmEntitySet.class);
    EdmEntityType edmEntityType = EasyMock.createMock(EdmEntityType.class);
    EasyMock.expect(edmEntityType.getMapping()).andStubReturn(null);
    EasyMock.expect(edmEntityType.getName()).andStubReturn("SOItem");
    EasyMock.replay(edmEntityType);
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
    EasyMock.expect(getEntitySetView.getTargetEntitySet()).andStubReturn(edmEntitySet);
    EdmEntitySet startEdmEntitySet = EasyMock.createMock(EdmEntitySet.class);
    EdmEntityType startEdmEntityType = EasyMock.createMock(EdmEntityType.class);
    EasyMock.expect(startEdmEntityType.getMapping()).andStubReturn(null);
    EasyMock.expect(startEdmEntityType.getName()).andStubReturn("SOHeader");
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

    final ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.OK, null, null);

    UriInfo uriInfo = mock(UriInfo.class);
    final FilterExpression filter = UriParser.parseFilter(null, null, "true");
    when(uriInfo.getFilter()).thenReturn(filter);
    final OrderByExpression orderBy = UriParser.parseOrderBy(null, null, "true");
    when(uriInfo.getOrderBy()).thenReturn(orderBy);
    List<ArrayList<NavigationPropertySegment>> expand = new ArrayList<ArrayList<NavigationPropertySegment>>();
    NavigationPropertySegment segment = mock(NavigationPropertySegment.class);
    EdmNavigationProperty navigationProperty = mock(EdmNavigationProperty.class);
    when(navigationProperty.getName()).thenReturn("nav");
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

   * @throws ODataJPARuntimeException
   */

  @Test
  public void testBuildSimpleQuery() throws EdmException, ODataJPARuntimeException {
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
    JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, null);
    jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl);

    assertEquals("SELECT E1 FROM SalesOrderHeader E1", jpqlSelectStatementBuilder.build().toString());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.