cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Variations of 'like'
Date Fri, 21 Nov 2014 12:19:21 GMT
Another API idea that I just had while analyzing boilerplate code of the client Cayenne apps.
An argument to (or second argument to ExpressionFactory.likeExp(..)) requires
a full pattern to match against. So people would often write their own utility code to wrap
a String in "%" signs. Cayenne can easily take care of this via the following methods:

// same as"%" + string + "%");

// same as + "%");

// same as"%" + string);

In addition to saving the user from String concatenation, these new methods can do proper
symbol escaping, making "like" much safer to use.

View raw message