/** * @param path * @return */ public BooleanPath get(BooleanPath path) { BooleanPath newPath = getBoolean(toString(path)); return addMetadataOf(newPath, path); }
/** * {@inheritDoc} */ @Override public <T> BooleanExpression createBooleanExpression( PathBuilder<T> entityPath, String fieldName, String searchStr) { if (StringUtils.isBlank(searchStr)) { return null; } Boolean value = null; // I18N: Spanish (normalize search value: trim start-end and lower case) if ("si".equals(StringUtils.trim(searchStr).toLowerCase())) { value = Boolean.TRUE; } else { value = BooleanUtils.toBooleanObject(searchStr); } // if cannot parse to boolean or null input if (value == null) { return null; } BooleanExpression expression = entityPath.getBoolean(fieldName).eq( value); return expression; }
/** * {@inheritDoc} */ @Override public <T> BooleanExpression createBooleanExpression( PathBuilder<T> entityPath, String fieldName, Object searchObj, String operator) { Boolean value = BooleanUtils.toBooleanObject((String) searchObj); if (value != null) { if (StringUtils.equalsIgnoreCase(operator, OPERATOR_GOE)) { return entityPath.getBoolean(fieldName).goe(value); } else if (StringUtils.equalsIgnoreCase(operator, "gt")) { return entityPath.getBoolean(fieldName).gt(value); } else if (StringUtils.equalsIgnoreCase(operator, OPERATOR_LOE)) { return entityPath.getBoolean(fieldName).loe(value); } else if (StringUtils.equalsIgnoreCase(operator, "lt")) { return entityPath.getBoolean(fieldName).lt(value); } } return entityPath.get(fieldName).eq(searchObj); }
if (value != null) { if (StringUtils.equalsIgnoreCase(operator, OPERATOR_GOE)) { return entityPath.getBoolean(fieldName).goe(value); return entityPath.getBoolean(fieldName).gt(value); return entityPath.getBoolean(fieldName).loe(value); return entityPath.getBoolean(fieldName).lt(value);
return entityPath.getBoolean(fieldName).eq(Boolean.TRUE); return entityPath.getBoolean(fieldName).eq(Boolean.FALSE); Matcher isNullMatcher = isNullOperator.matcher(searchStr); if (isNullMatcher.matches()) { return entityPath.getBoolean(fieldName).isNull(); Matcher isNotNullMatcher = isNotNullOperator.matcher(searchStr); if (isNotNullMatcher.matches()) { return entityPath.getBoolean(fieldName).isNotNull();
return entityPath.getBoolean(fieldName).eq(Boolean.TRUE); return entityPath.getBoolean(fieldName).eq(Boolean.FALSE); Matcher isNullMatcher = isNullOperator.matcher(searchStr); if (isNullMatcher.matches()) { return entityPath.getBoolean(fieldName).isNull(); Matcher isNotNullMatcher = isNotNullOperator.matcher(searchStr); if (isNotNullMatcher.matches()) { return entityPath.getBoolean(fieldName).isNotNull();
BooleanExpression expression = entityPath.getBoolean(fieldName).eq( value); return expression;