通过未配置为级联实体持久操作的关系 *** 找到了一个新实体
A new entity was found through the relationship *** that was not configured to cascade persist operations for entity
我目前正在为一些测试创建一些固定装置,但我遇到了这个错误。您知道如何解决吗?
我有很多灯具要复制粘贴它。
A new entity was found through the relationship '***' that was not configured to cascade persist operations for entity:
***. To solve this issue: Either explicitly call EntityManager#persist() on
this unknown entity or configure cascade persist this association in the
mapping for example @OneToOne(..,cascade={"persist"}). If you cannot find
out which entity causes the problem implement '***#__toString()' to get a clue.
错误的意思是当前对象中有关联的实体还没有保存到数据库中。您要么需要确保您的关系设置为级联持久调用(意味着它将自动保存),要么您需要在保存当前实体之前持久保存未保存的实体。
我目前正在为一些测试创建一些固定装置,但我遇到了这个错误。您知道如何解决吗?
我有很多灯具要复制粘贴它。
A new entity was found through the relationship '***' that was not configured to cascade persist operations for entity:
***. To solve this issue: Either explicitly call EntityManager#persist() on
this unknown entity or configure cascade persist this association in the
mapping for example @OneToOne(..,cascade={"persist"}). If you cannot find
out which entity causes the problem implement '***#__toString()' to get a clue.
错误的意思是当前对象中有关联的实体还没有保存到数据库中。您要么需要确保您的关系设置为级联持久调用(意味着它将自动保存),要么您需要在保存当前实体之前持久保存未保存的实体。