我出现了一个我不明白的问题。下面的代码不起作用:实体在EntityClass(Grails 3.3.0.RC1; Grom 6.1.5)中设置属性时未保存
AccountingEntity accountingEntity = AccountingEntity.get(params.id);
accountingEntity.setLifecycleStatusToArchived();
accountingEntity.save(flush:true);
凡方法setLivecylceStatusToArchived样子:
void setLifecycleStatusToArchived() {
this.lifecycleStatus = AccountingEntity.LIFECYCLE_ARCHIVED; //predefined static variable
this.considerForRankingJob = false;
this.dateArchived = new Date();
}
问题是,实体没有更新。 当我事先使用accountingEntity.validate()时没有验证错误。
然而,此代码的工作:
AccountingEntity accountingEntity = AccountingEntity.get(params.id);
accountingEntity.setDateArchived(new Date());
accountingEntity.setConsiderForRankingJob(false);
accountingEntity.setLifecycleStatus(AccountingEntity.LIFECYCLE_ARCHIVED);
accountingEntity.save(flush:true);
的代码没有,除非我跟着指南中的所有步骤从Grails的3.2.9更新后,任何工作更加3.3.0.RC1(http://docs.grails.org/3.3.x/guide/upgrading.html)和其余的代码工作正常(还有数据库访问等)
有没有人有想法?问题可能是什么?
在此先感谢和问候!
这是问题!谢谢! – Kloker