JHipster添加JPA @ManyToMany会阻止应用程序启动

时间:2020-06-02 22:05:27

标签: database jpa spring-data-jpa jhipster

在过去的几件事中,我一直在从事JHipster项目,事情进展相对顺利。我的应用程序的数据模型中存在几种关系,并且我已经多次迭代了数据模型,添加了新实体,并使用没有新关系的实体更新了现有实体。

由于某些未知原因,在两个实体之间添加新的@ManyToMany或@OneToMany关系似乎阻止了应用程序启动。该应用程序似乎即将启动并停止,每隔几秒钟记录一次GC警告,如下所示: [gc][30] overhead, spent [993ms] collecting in the last [1.3s]

冒犯的实体看起来像:

Long id;

@OneToMany //Relationship works fine
Set<OtherClass> otherClassObjects = new HashSet<>();

@ManyToMany //Working ok. 
@JoinTable(name, joinColumns, inverseJoinColumn)
Set<User> users = new HashSet();

@ManyToMany //Causes application to hang. The user entity is also linked to this entity with two @ManyToMany relationships, both are functional. 
@JoinTable(name, joinColumns, inverseJoinColumn)
Set<Places> Places = new HashSet();


我知道这可能不足以全面诊断问题,但我希望您能就如何最好地解决此问题提供任何指导。我几乎可以肯定是这种关系引起了问题,因为回滚创建关系所需的更改使应用程序可以正常启动。

0 个答案:

没有答案