Create Entity by using EntityListener
<p>I have a customer which has an association to a customerBudget entity. A CustomerEntityListener will create a customerBudget entity.</p>

<p>I get the following error:</p>

<pre><code>IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: de.company.entity.Customer-c4775b5b-413b-0567-3612-e0860bca9300 [new,managed].
</code></pre>

<p>the code in onAfterInsert(Customer entity)</p>

<pre><code>    LoadContext&lt;Customer&gt; loadContext = LoadContext.create(Customer.class);
    loadContext.setId(entity.getId());
    Customer customer = dataManager.load(loadContext);

    CustomerBudget customerBudget = new CustomerBudget();
    customerBudget.setCustomer(customer);

    CommitContext commitContext = new CommitContext(customerBudget);
    dataManager.commit(commitContext);
</code></pre>

<p>How can I create and persist Entites in an EntityListener?</p>