简体   繁体   中英

grails GORM or statement

what I am trying to do is

Item.findAllByNameIlikeOrDescriptionIlike(search)

where search is a string. It gives me the possible solution of

findAllByNameIlikeOrDescriptionIlike([Ljava.lang.Object;)

and throws the following error

Item.findAllByNameIlikeOrDescriptionIlike() is applicable for argument types: (java.lang.String) values: [f]

What is the correct way to try and achieve this?

Grails不知道您想在两个测试中使用相同的搜索参数,它希望看到NameIlike的一个参数和DescriptionILike的第二个参数:

Item.findAllByNameIlikeOrDescriptionIlike(search, search)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM