use of de.janrufmonitor.repository.search.ISearchTerm in project janrufmonitor by tbrandt77.
the class HsqldbMultiPhoneCallerDatabaseHandler method createSearchTerm.
private String createSearchTerm(ISearchTerm[] searchTerms) {
if (searchTerms == null)
return "";
if (searchTerms.length == 0)
return "";
StringBuffer sql = new StringBuffer();
sql.append(" (");
ISearchTerm st = null;
for (int i = 0, j = searchTerms.length; i < j; i++) {
st = searchTerms[i];
sql.append("LOWER(content) like LOWER('%");
// remove % signs in search term
sql.append(StringUtils.replaceString(st.getSearchTerm(), "%", ""));
sql.append("%')");
if (i < (j - 1)) {
sql.append(" ");
sql.append(st.getOperator().toString());
sql.append(" ");
}
}
sql.append(")");
return sql.toString();
}
Aggregations