私はそのようなドメインクラスを持っています:
class ServicesGroup {
Long id
String name
String description
String toString(){
return name
}
static mapping = {
version false
table 'root.services_groups'
id column:'group_id'
name column:'group_name'
description column:'group_desc'
}
}
と
class Step {
Long id
ServicesGroup service
String stepType
Integer stepFrom
Integer stepTo
static constraints = {
stepType(inList:['operator', 'client'])
}
static mapping = {
version false
table 'bill.steps'
service column:'service_group_id'
}
}
関係は次のとおりです。1 つの ServicesGroup エントリに複数の Step インスタンスを含めることができます。
ただし、コントローラーでしようとすると
Step.findByService(3)
私は得る:
"org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: Step.findByService() is applicable for argument types: (java.lang.Integer) values: {3}"
ただし、 Step ドメインクラスフィールドを変更すると
ServicesGroup service
単純に
Long service
できます。
何が起きてる?