这是我的池域类:
class Pool {
//Can be account id or name dependent on input csv format
String poolName
static hasMany = [accountToFollow:AccountToFollow]
static constraints = {
poolName nullable: false,unique: true
accountToFollow nullable: true
}
}
以下是我如何检索特定池的accountToFollow
def poolInstance = Pool.findByPoolName("First Pool")
int count = Integer.parseInt(params.numHandlesToFollow)
println "AccountToFollow: ${poolInstance.accountToFollow.size()}"
数据库中有超过50K的accountToFollow(通过在编辑" First Pool"并检查数据库时列出accountToFollow确认)。 为什么我得到0?