@Test public void filterWhenUsingBangInLike() { Query query = mock(Query.class); when(query.getLanguage()).thenReturn(Query.HQL); when(query.getStatement()).thenReturn("select a from b where ref like :likeValue"); Map<String, Object> parameters = new LinkedHashMap<>(); parameters.put("likeValue", new DefaultQueryParameter(query).like("%some!thing%")); when(query.getNamedParameters()).thenReturn(parameters); Query filteredQuery = this.filter.filterQuery(query); assertEquals("SELECT a FROM b WHERE ref LIKE :likeValue ESCAPE '!'", filteredQuery.getStatement()); assertEquals("%some!!thing%", filteredQuery.getNamedParameters().get("likeValue")); }
@Override public Query filterQuery(Query query) { return new EscapeLikeParametersQuery(query); }
EscapeLikeParametersFilter implements QueryFilter { @Override public Query filterQuery(Query query) { return new EscapeLikeParametersQuery(query); } }
EscapeLikeParametersFilter implements QueryFilter { @Override public Query filterQuery(Query query) { return new EscapeLikeParametersQuery(query); }  }
EscapeLikeParametersFilter implements QueryFilter { @Override public Query filterQuery(Query query) { return new EscapeLikeParametersQuery(query); }  @Override Query filterQuery(Query query); @Override String filterStatement(String statement, String language); @Override List filterResults(List results); }
EscapeLikeParametersFilter implements QueryFilter { @Override public Query filterQuery(Query query) { return new EscapeLikeParametersQuery(query); }  @Override Query filterQuery(Query query); @Override String filterStatement(String statement, String language); @Override List filterResults(List results);  }