Archive

Posts Tagged ‘Merge’

Why cascade merge didn’t work

October 13, 2008 Leave a comment

Problem

I ran into a problem with JPA not saving my related entities when I merged them, even though I had set cascade to persist.

Solution

It turns out that both Cascade.PERSIST and Cascade.MERGE have to be specified on a JPA entity. Just PERSIST does not apply to situations were an existing entity is merged after having been linked to new entities.

Categories: Java Tags: , , ,