I have a table of votes and a table of users, where for each vote entered the user can be identified (relationship one-to-many ).
If the user does not identify himself, how do I insert NULL
into the foreign key of the user? I tried to create a new user object and perform the insert but could not.
The error always returned is as follows:
A new entity was found through the relationship 'Portal \ Model \ Voto # usuario' that was not configured to cascade persist operations for entity: Portal \ Model \ User @ 000000000199805b000000000453ebc2. To solve this issue: Either explicitly call EntityManager # persist () on this unknown entity or set cascade persist this association in the mapping for example @ManyToOne (.., cascade = {"persist"}). If you can not find out which entity causes the problem to implement 'Portal \ Model \ User #__ toString ()' to get a clue.