【发布时间】:2010-09-21 08:01:36
【问题描述】:
我是 grails 新手,收到以下错误:No signature of method: Something.findAll() is applicable for argument types: (java.lang.String, java.util.ArrayList) values: [from Something AS s WHERE s.some_number LIKE ?, [%asdf%]]"
当我运行test-app 时发生错误。它发生在以下地方:
SomethingVO[] findBySomeNumber(String searchString) {
searchString = "%"+searchString+"%"
return Something.findAll("from Something AS s WHERE s.some_number LIKE ?",[searchString]).collect {
new SomethingVO(it);
}
}
Something 类是域对象:
package some.project.domain
class Something{
static belongsTo = [product:Product, productVersion:ProductVersion]
Long id
String name
String someNumber
static constraints = {
product (nullable:true)
productVersion (nullable:true)
}
}
错在哪里?
(我使用 Grails 1.2.4)
【问题讨论】:
标签: grails groovy grails-orm findall