Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP_LIKE is not working #116

Open
GoogleCodeExporter opened this issue Dec 18, 2015 · 0 comments
Open

OP_LIKE is not working #116

GoogleCodeExporter opened this issue Dec 18, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. When i add like filter it is not wokring but others filters are working. 
Problem at "OP_LIKE". can you help me to solve this problem/. I use jquery 
datatable. i have filter segment on table. when i write something or on first 
loading. there is no data on datatable because of the filter segment. 
criterias.getSearch() is working good. Problem at this row

Filter f = new Filter("name", criterias.getSearch(), Filter.OP_LIKE);
        search.addFilter(f);

my full method is below/

@Override
    public DataSet<AgeRangeDTO> findAgeRangeWithDatatablesCriterias(DatatablesCriterias criterias) {

        Search search = new Search(AgeRange.class);

        Filter f = new Filter("name", criterias.getSearch(), Filter.OP_LIKE);
        search.addFilter(f);

        // sorting
        final List<ColumnDef> sortingColumnDefs = criterias.getSortingColumnDefs();

        if (!CollectionUtils.isEmpty(sortingColumnDefs)) {

            for (ColumnDef columnDef : sortingColumnDefs) {

                final ColumnDef.SortDirection sortDirection = columnDef.getSortDirection();
                switch (sortDirection) {
                case ASC:
                    search.addSort(columnDef.getName(), true);      
                    break;
                case DESC:
                    search.addSort(columnDef.getName(), false);
                    break;
                }

            }
        }
        search.setMaxResults(criterias.getDisplaySize());
        search.setPage(criterias.getDisplayStart());

        SearchResult<AgeRange> result = ageRangeDAO.searchAndCount(search);

        List<AgeRangeDTO> dtoList = new ArrayList<AgeRangeDTO>();
        for (AgeRange obj : result.getResult()) {
            AgeRangeDTO dt = new AgeRangeDTO();
            dt.setId(obj.getId());
            dt.setDescription(obj.getDescription());
            dt.setName(obj.getName());
            dt.setEnabled(obj.getEnabled());
            dtoList.add(dt);
        }

        DataSet<AgeRangeDTO> dataset = new DataSet<AgeRangeDTO>(dtoList, new Long(result.getTotalCount()), new Long(criterias.getDisplaySize()));

        return dataset;
    }

Original issue reported on code.google.com by ozalpnuri on 22 Feb 2015 at 11:19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant