How can i use “%” in criteria-like statements in this example:
def c = Shop.createCriteria()
def results = c.list {
like("name", "Harrods")
def aha = params.name
like("store.name", %aha%) ##
}
The “%aha%” part doesnt work. but it does work if i do “%ola%”. So how to solve the problem ?
Or in addiction, instead of “%aha”, how can i use criteria builder using ‘contains’ groovy method instead of like?
replace the following
with