@Test public void filterStatementWhenStatementDoesntMatches() { String result = this.filter.filterStatement("select whatever", Query.HQL); assertEquals("select whatever", result); }
@Override public String filterStatement(String statement, String language) { String result = statement.trim(); if (Query.HQL.equals(language) && isFilterable(result)) { result = SELECT_CLAUSE_TO_EXTEND + ", doc.language" + result.substring(SELECT_CLAUSE_TO_EXTEND.length()); } return result; }
LanguageQueryFilter implements QueryFilter { @Override public String filterStatement(String statement, String language) { String result = statement.trim(); if (Query.HQL.equals(language) && isFilterable(result)) { result = SELECT_CLAUSE_TO_EXTEND + ", doc.language" + result.substring(SELECT_CLAUSE_TO_EXTEND.length()); } return result; } }
LanguageQueryFilter implements QueryFilter { @Override public String filterStatement(String statement, String language) { String result = statement.trim(); if (Query.HQL.equals(language) && isFilterable(result)) { result = SELECT_CLAUSE_TO_EXTEND + ", doc.language" + result.substring(SELECT_CLAUSE_TO_EXTEND.length()); } return result; }  }
LanguageQueryFilter implements QueryFilter { @Override public String filterStatement(String statement, String language) { String result = statement.trim(); if (Query.HQL.equals(language) && isFilterable(result)) { result = SELECT_CLAUSE_TO_EXTEND + ", doc.language" + result.substring(SELECT_CLAUSE_TO_EXTEND.length()); } return result; }  @Override String filterStatement(String statement, String language); @Override List filterResults(List results); }
LanguageQueryFilter implements QueryFilter { @Override public String filterStatement(String statement, String language) { String result = statement.trim(); if (Query.HQL.equals(language) && isFilterable(result)) { result = SELECT_CLAUSE_TO_EXTEND + ", doc.language" + result.substring(SELECT_CLAUSE_TO_EXTEND.length()); } return result; }  @Override String filterStatement(String statement, String language); @Override List filterResults(List results);  }