【发布时间】:2020-08-17 20:43:04
【问题描述】:
在领域模型中,Category 与 Tag 实体有 ManyToOne 关系,Tag 与 OfferingDetail 有 ManyToOne。 我在 TagServiceImpl_Roo_Service_Impl.aj 文件中遇到这些错误:
The method setTag(null) is undefined for the type OfferingDetail
其他几个实体也出现类似错误。 setter/getter 是 .aj 源文件。令人惊讶的是,错误只出现在下面的第一个 setTag 上,而不是第二个!为什么会出现此错误,我该如何解决?我试过重新索引 JDT 编织。
@Transactional public void TagServiceImpl.delete(Tag tag) { // Clear bidirectional many-to-one child relationship with Category if (tag.getCategory() != null) { tag.getCategory().getTags().remove(tag); } // Clear bidirectional one-to-many parent relationship with OfferingDetail for (OfferingDetail item : tag.getOurPlay()) { item.setTag(null); } // Clear bidirectional one-to-many parent relationship with UseCase for (UseCase item : tag.getUseCases()) { item.setTag(null); } getTagRepository().delete(tag); }
【问题讨论】:
标签: spring-boot aspectj spring-roo aspectj-maven-plugin