Java Code Examples for com.querydsl.core.BooleanBuilder#getValue()
The following examples show how to use
com.querydsl.core.BooleanBuilder#getValue() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NasService.java From radman with MIT License | 5 votes |
private Predicate buildNasSearchPredicate(@Nullable String searchText) { BooleanBuilder booleanBuilder = new BooleanBuilder(); if (!StringUtils.isEmpty(searchText)) { booleanBuilder.or(QNas.nas.nasName.contains(searchText)); booleanBuilder.or(QNas.nas.shortName.contains(searchText)); booleanBuilder.or(QNas.nas.description.contains(searchText)); booleanBuilder.or(QNas.nas.ports.like(searchText)); booleanBuilder.or(QNas.nas.secret.contains(searchText)); booleanBuilder.or(QNas.nas.server.contains(searchText)); booleanBuilder.or(QNas.nas.type.contains(searchText)); } return booleanBuilder.getValue(); }
Example 2
Source File: AccountingService.java From radman with MIT License | 5 votes |
private Predicate buildAccountingSearchPredicate(@NonNull AccountingFilter filter) { BooleanBuilder booleanBuilder = new BooleanBuilder(); if (!(StringUtils.isEmpty(filter.getSearchText()))) { booleanBuilder.or(QRadAcct.radAcct.acctSessionId.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.acctUniqueId.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.username.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.realm.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.nasIpAddress.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.nasPortId.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.nasPortType.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.acctInterval.stringValue().contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.acctSessionTime.stringValue().contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.acctAuthentic.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.connectInfoStart.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.connectInfoStop.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.acctInputOctets.stringValue().contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.acctOutputOctets.stringValue().contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.calledStationId.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.callingStationId.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.acctTerminateCause.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.serviceType.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.framedProtocol.contains(filter.getSearchText())); booleanBuilder.or(QRadAcct.radAcct.framedIpAddress.contains(filter.getSearchText())); } if (filter.isSearchOnlyActiveSessions()) { booleanBuilder.and(QRadAcct.radAcct.acctStartTime.isNotNull()); booleanBuilder.and(QRadAcct.radAcct.acctStopTime.isNull()); } return booleanBuilder.getValue(); }
Example 3
Source File: QDataTablesRepositoryImpl.java From spring-data-jpa-datatables with Apache License 2.0 | 5 votes |
@Override public <R> DataTablesOutput<R> findAll(DataTablesInput input, Predicate additionalPredicate, Predicate preFilteringPredicate, Function<T, R> converter) { DataTablesOutput<R> output = new DataTablesOutput<>(); output.setDraw(input.getDraw()); if (input.getLength() == 0) { return output; } try { long recordsTotal = preFilteringPredicate == null ? count() : count(preFilteringPredicate); if (recordsTotal == 0) { return output; } output.setRecordsTotal(recordsTotal); PredicateBuilder predicateBuilder = new PredicateBuilder(this.builder, input); BooleanBuilder booleanBuilder = new BooleanBuilder() .and(predicateBuilder.build()) .and(additionalPredicate) .and(preFilteringPredicate); Predicate predicate = booleanBuilder.getValue(); Page<T> data = predicate != null ? findAll(predicate, predicateBuilder.createPageable()) : findAll(predicateBuilder.createPageable()); @SuppressWarnings("unchecked") List<R> content = converter == null ? (List<R>) data.getContent() : data.map(converter).getContent(); output.setData(content); output.setRecordsFiltered(data.getTotalElements()); } catch (Exception e) { output.setError(e.toString()); } return output; }
Example 4
Source File: QueryDslPredicates.java From spring4-sandbox with Apache License 2.0 | 5 votes |
public static Predicate pastConferences(Date _past) { QConference conf = QConference.conference; final Date now = new Date(); BooleanBuilder builder = new BooleanBuilder(); builder.and(conf.endedDate.before(now)); if (_past != null) { builder.and(conf.startedDate.after(_past)); } return builder.getValue(); }