public static Condition createWildCardedStringCondition(final Field<String> field,
                                                            final String filter,
                                                            final boolean allowWildCards) {
        if (filter != null) {
            if (allowWildCards && filter.contains(PatternUtil.STROOM_WILD_CARD_CHAR)) {
                final String likeStr = PatternUtil.createSqlLikeStringFromWildCardFilter(filter);
                LOGGER.debug("field.like({})", likeStr);
                return field.like(likeStr);
            }
            LOGGER.debug("field.eq({})", filter);
            return field.eq(filter);
        } else {
            LOGGER.debug("field.isNull()");
            return field.isNull();
        }
    }
If allowWildCards is true and filter is wild carded (i.e. contains a '*') then it
returns 'field.like(x)' where x has
'*' characters replaced by '%' and SQL wild cards '%' and '_' are escaped.
If filter is not wild carded it returns 'field.eq(filter)'
stroom-db-util/src/main/java/stroom/db/util/JooqUtil.java