Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] No merging with CascadeType.ALL set

Hello,

I'v got two classes
@Entity class Schedule {
  @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="schedule")
  private Set<ScheduleEntry> entries = new HashSet<ScheduleEntry> (17);
  ...
}

@Entity class ScheduleEntry {
  @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="schedule_id", nullable=false)
  private Schedule schedule;
  ...
}

So I'd expect when em.merge() is called on a Schedule instance, the contained entries are also
merged. But this is not the case.

Do I misunderstand the idea behind CascadeType.MERGE (and CascadeType.ALL, of course) or might
this be an issue of EclipseLink?

(We're using EclipseLink 1.2.0 in a Java SE Application)

- michael


Back to the top