Search in sources :

Example 11 with Filter

use of com.axelor.studio.db.Filter in project axelor-open-suite by axelor.

the class ChartRecordViewServiceImpl method getYearMonthFilters.

protected List<Filter> getYearMonthFilters(Filter filter, long startId, long endId) {
    List<Filter> startEndFilter = new ArrayList<>();
    Filter startDateFilter = JPA.copy(filter, false);
    startDateFilter.setId(startId);
    startDateFilter.setOperator(">=");
    Filter endDateFilter = JPA.copy(filter, false);
    endDateFilter.setId(endId);
    endDateFilter.setOperator("<=");
    startEndFilter.add(startDateFilter);
    startEndFilter.add(endDateFilter);
    return startEndFilter;
}
Also used : Filter(com.axelor.studio.db.Filter) ArrayList(java.util.ArrayList)

Example 12 with Filter

use of com.axelor.studio.db.Filter in project axelor-open-suite by axelor.

the class ChartRecordViewServiceImpl method createFilter.

protected Filter createFilter(Long id, Boolean isTargetJson, Boolean isJson, MetaJsonField jsonField, MetaField metaField, String targetField, String targetType, boolean isNull, String operator) {
    Filter filter = new Filter();
    filter.setId(id);
    filter.setIsTargetJson(isTargetJson);
    if (isJson) {
        filter.setIsJson(true);
        filter.setMetaJsonField(jsonField);
    } else {
        filter.setMetaField(metaField);
    }
    filter.setTargetField(targetField);
    filter.setTargetType(targetType);
    if (isNull) {
        filter.setOperator("isNull");
    } else {
        filter.setOperator(operator);
        filter.setIsParameter(true);
    }
    return filter;
}
Also used : Filter(com.axelor.studio.db.Filter)

Aggregations

Filter (com.axelor.studio.db.Filter)12 MetaField (com.axelor.meta.db.MetaField)4 MetaJsonField (com.axelor.meta.db.MetaJsonField)2 ArrayList (java.util.ArrayList)2 MetaFieldRepository (com.axelor.meta.db.repo.MetaFieldRepository)1 FilterSqlService (com.axelor.studio.service.filter.FilterSqlService)1