Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Eclipselink support for one-way ManyToOne relationships?


On Tue, Apr 2, 2019 at 11:24 AM Christopher Delahunt <christopher.delahunt@xxxxxxxxxx> wrote:
>
> You mentions save/merge - which is it?
>
> You should use em.persist(p); em.flush(); so that the primary key gets set from the IDENTITY in the DB.
>  If you are using merge, you must pass back and use the reference returned from the em.merge call or it will be treated as an unmanaged instance, which is why you are getting a separate insert on each call.

Thanks.

I was using the spring data repository save methods. Let me try with the entity manager.

Cheers,
Glenn

Back to the top