Package com.vaadin.data.util.filter

Examples of com.vaadin.data.util.filter.Not


    @Test
    public void getWhereStringForFilters_NotFilter() {
        StatementHelper sh = mockedStatementHelper(18);
        ArrayList<Filter> filters = new ArrayList<Filter>();
        filters.add(new Not(new Equal("AGE", 18)));
        Assert.assertEquals(" WHERE NOT \"AGE\" = ?",
                QueryBuilder.getWhereStringForFilters(filters, sh));
        EasyMock.verify(sh);
    }
View Full Code Here


    @Test
    public void getWhereStringForFilters_complexNegatedFilter() {
        StatementHelper sh = mockedStatementHelper(65, 18);
        ArrayList<Filter> filters = new ArrayList<Filter>();
        filters.add(new Not(new Or(new Equal("AGE", 65), new Equal("AGE", 18))));
        Assert.assertEquals(" WHERE NOT (\"AGE\" = ? OR \"AGE\" = ?)",
                QueryBuilder.getWhereStringForFilters(filters, sh));
        EasyMock.verify(sh);
    }
View Full Code Here

    }

    @Test
    public void getWhereStringForFilters_isNotNull() {
        ArrayList<Filter> filters = new ArrayList<Filter>();
        filters.add(new Not(new IsNull("NAME")));
        Assert.assertEquals(" WHERE \"NAME\" IS NOT NULL", QueryBuilder
                .getWhereStringForFilters(filters, new StatementHelper()));
    }
View Full Code Here

    @Test
    public void getWhereStringForFilters_customStringDecorator() {
        QueryBuilder.setStringDecorator(new StringDecorator("[", "]"));
        ArrayList<Filter> filters = new ArrayList<Filter>();
        filters.add(new Not(new IsNull("NAME")));
        Assert.assertEquals(" WHERE [NAME] IS NOT NULL", QueryBuilder
                .getWhereStringForFilters(filters, new StatementHelper()));
        // Reset the default string decorator
        QueryBuilder.setStringDecorator(new StringDecorator("\"", "\""));
    }
View Full Code Here

        return filter instanceof Not;
    }

    @Override
    public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
        Not not = (Not) filter;
        if (not.getFilter() instanceof IsNull) {
            IsNull in = (IsNull) not.getFilter();
            return QueryBuilder.quote(in.getPropertyId()) + " IS NOT NULL";
        }
        return "NOT "
                + QueryBuilder.getWhereStringForFilter(not.getFilter(), sh);
    }
View Full Code Here

    public boolean translatesFilter(Filter filter) {
        return filter instanceof Not;
    }

    public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
        Not not = (Not) filter;
        if (not.getFilter() instanceof IsNull) {
            IsNull in = (IsNull) not.getFilter();
            return QueryBuilder.quote(in.getPropertyId()) + " IS NOT NULL";
        }
        return "NOT "
                + QueryBuilder.getWhereStringForFilter(not.getFilter(), sh);
    }
View Full Code Here

        return filter instanceof Not;
    }

    @Override
    public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
        Not not = (Not) filter;
        if (not.getFilter() instanceof IsNull) {
            IsNull in = (IsNull) not.getFilter();
            return QueryBuilder.quote(in.getPropertyId()) + " IS NOT NULL";
        }
        return "NOT "
                + QueryBuilder.getWhereStringForFilter(not.getFilter(), sh);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.data.util.filter.Not

Copyright © 2018 www.massapicom. 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.