gorm - Find instance by name where query is any part of its name, Grails -


in java, string search its' substring goes this:

string string = "madam, adam"; b = string.matches("(?i).*i am.*"); 

how find instance in grails name query part of name?

i think you're looking for

domainclass.findbynameilike("%i am%") 

that case insensitive search record name containing "i am". not efficient way query database, if application experience kind of load, should use sparingly.

edit: documentation


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -