我有一个域名如下:
class Author {
String id
static hasMany = [accounts: Account]
static belongsTo = Account
static mapping = {
accounts joinTable: [name: "SOMETABLE", key: 'SOMEFIELD'],
ignoreNotFound: true
}
static constraints = {}
}
Run Code Online (Sandbox Code Playgroud)
没有找到记录时,我收到以下错误.我尝试了ignoreNotFound,它无法正常工作.
error message: accounts=org.hibernate.ObjectNotFoundException:
No row with the given identifier exists:
[com.myapplication.Account#123465489785]
Run Code Online (Sandbox Code Playgroud)
尝试选择您无权在数据库中插入的连接2记录时会发生这种情况.请问有解决方法吗?