我试图简单地从瞬态字段验证器引用不同的域字段(benefiaryname)。如何做到这一点?
class Fytrnlt {
transient Boolean firevalidation = false
String checknum
String bankcode
String branchcode
String benefiaryname
............
firevalidation validator: {inputValue, obj ->
// def CheckResult = obj.bannerService.documentValidation(inputValue, benefiaryname, null)
def CheckResult = obj.bannerService.documentValidation(inputValue, {benefiaryname}, null)
if (CheckResult != 1)
return false
} */
答案 0 :(得分:1)
在验证器函数中,obj变量是当前对象,因此,您应该能够简单地引用obj.beneficiaryname
。