I have submitted a patch to JIRA here
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-334
This adds the possibility to add automatic wildcards like this:
Example.create(exampleObject).enableLike(Example.MATCH_ANYWHERE)
You can use MATCH_ANYWHERE, MATCH_PREFIX and MATCH_SUFFIX to create patterns like %xxx%, xxx% and %xxx
I also found a bug with Example.ignoreCase, which actually was not working at all.
Probably it would be useful to delegate not only the sql-String generation but also the generation of the TypedValues to LikeExpression and EqExpression. The way it works now there is some duplicate logic here.
This was my first patch submitted for Hibernate, is the format, etc. correct?