gorm - How to use Grails findAll with toString from a complex object? -


is there way use grails findall tostring complex object?

i have object named person (example).

person has firstname , lastname attributes , there tostring method returns "firstname: " + firstname + "lastname: " + lastname

and there object have person named group. group has attribute of person.

i want search like:

group.findall{     ilike("person.tostring", "%firstname%") } 

i'm getting following:

could not resolve property: person.tostring of: com.test.group. stacktrace follows: message: not resolve property: person.tostring of: com.test.group     line | method ->>  670 | docall               in grails.gorm.detachedcriteria$_list_closure2 

is there way use findall comparing tostring method? can't create getfirstandlastname because object plugin project , can't modified.

is there way use findall comparing tostring method?

no. way invoke tostring, or other method, on entities retrieve them, bring them app instances can created , invoke methods. if tostring happens return can simulate without invoking method might have options answer question asked "no".

i hope helps.


Comments