如何在 Grails Gorm 中查询 3 个表
How to query 3 tables in Grails Gorm
我是 grails 框架的新手,如何查询它们之间有关联的 3 个表
Class A{
static hasMany = [b:B]
}
enter code here
class B{
long aId // Id of table A
}
class c{
B b //B reference
}
SQL query: select * from C where b_id in (select id from B where a_id='10'_)
Any help will be appreciated.
直截了当
def list = C.withCriteria{
b{
eq 'aId', '10'
}
}
我是 grails 框架的新手,如何查询它们之间有关联的 3 个表
Class A{
static hasMany = [b:B]
}
enter code here
class B{
long aId // Id of table A
}
class c{
B b //B reference
}
SQL query: select * from C where b_id in (select id from B where a_id='10'_)
Any help will be appreciated.
直截了当
def list = C.withCriteria{
b{
eq 'aId', '10'
}
}