Examples of FilterItem


Examples of org.apache.metamodel.query.FilterItem

        Table orderlinesTable = schema.getTableByName("orderlines");
        Column commonProdIdColumn = orderlinesTable.getColumnByName("prod_id");
        Column quantityColumn = orderlinesTable.getColumnByName("quantity");

        q.from(orderlinesTable);
        q.where(new FilterItem(new SelectItem(prodIdColumn), OperatorType.EQUALS_TO, new SelectItem(commonProdIdColumn)));
        q.groupBy(titleColumn);
        q.getSelectClause().removeItem(q.getSelectClause().getSelectItem(productPriceColumn));
        SelectItem quantitySum = new SelectItem(FunctionType.SUM, quantityColumn).setAlias("orderAmount");
        q.select(quantitySum);
        q.having(new FilterItem(quantitySum, OperatorType.GREATER_THAN, 25));
        q.orderBy(new OrderByItem(q.getSelectClause().getItem(0)));

        assertEquals("SELECT \"products\".\"title\" AS product-title, SUM(\"orderlines\".\"quantity\") AS orderAmount "
                + "FROM public.\"products\", public.\"orderlines\" "
                + "WHERE \"products\".\"prod_id\" = \"orderlines\".\"prod_id\" " + "GROUP BY \"products\".\"title\" "
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

        Column priceColumn = productsTable.getColumnByName("price");
        Column cityColumn = customerTable.getColumnByName("city");
        Column ageColumn = customerTable.getColumnByName("age");
        q.select(titleColumn, priceColumn, cityColumn);

        q.where(new FilterItem(new SelectItem(priceColumn), OperatorType.GREATER_THAN, 27));
        q.where(new FilterItem(new SelectItem(ageColumn), OperatorType.GREATER_THAN, 55));

        assertEquals(
                "SELECT p.\"title\", p.\"price\", c.\"city\" FROM public.\"products\" p, public.\"customers\" c WHERE p.\"price\" > 27 AND c.\"age\" > 55",
                q.toString());
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

    }
    if (column == null) {
      throw new IllegalArgumentException("column cannot be null");
    }
    if (_parentOrFilter == null) {
      _parentOrFilter = new FilterItem(_orFilters);
    }
    return new HavingBuilderImpl(function, column, _query, _parentOrFilter,
        _orFilters, getQueryBuilder());
  }
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

        q.from(employeeTable, "o");
        SelectItem countrySelect = new SelectItem(countryColumn);
        q.select(countrySelect, new SelectItem(FunctionType.SUM, creditLimitColumn));
        q.groupBy(countryColumn);
        q.orderBy(new OrderByItem(countrySelect));
        q.where(new FilterItem(new SelectItem(employeeNumberColumn1), OperatorType.EQUALS_TO, new SelectItem(
                employeeNumberColumn2)));

        assertEquals(
                "SELECT c.\"COUNTRY\", SUM(c.\"CREDITLIMIT\") FROM PUBLIC.\"CUSTOMERS\" c, PUBLIC.\"EMPLOYEES\" o WHERE c.\"SALESREPEMPLOYEENUMBER\" = o.\"EMPLOYEENUMBER\" GROUP BY c.\"COUNTRY\" ORDER BY c.\"COUNTRY\" ASC",
                q.toString());
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

     *
     * @param queryParameter
     * @return
     */
    public B applyFilter(OperatorType operator, Object operand) {
        return applyFilter(new FilterItem(_selectItem, operator, operand));
    }
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

        return applyFilter(new FilterItem(_selectItem, operator, operand));
    }

    @Override
    public B in(Collection<?> values) {
        return applyFilter(new FilterItem(_selectItem, OperatorType.IN, values));
    }
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

        return applyFilter(new FilterItem(_selectItem, OperatorType.IN, values));
    }

    @Override
    public B in(Number... numbers) {
        return applyFilter(new FilterItem(_selectItem, OperatorType.IN, numbers));
    }
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

        return applyFilter(new FilterItem(_selectItem, OperatorType.IN, numbers));
    }

    @Override
    public B in(String... strings) {
        return applyFilter(new FilterItem(_selectItem, OperatorType.IN, strings));
    }
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

        return applyFilter(new FilterItem(_selectItem, OperatorType.IN, strings));
    }

    @Override
    public B isNull() {
        return applyFilter(new FilterItem(_selectItem, OperatorType.EQUALS_TO, null));
    }
View Full Code Here

Examples of org.apache.metamodel.query.FilterItem

        return applyFilter(new FilterItem(_selectItem, OperatorType.EQUALS_TO, null));
    }

    @Override
    public B isNotNull() {
        return applyFilter(new FilterItem(_selectItem, OperatorType.DIFFERENT_FROM, null));
    }
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.