Skip to main content

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

Hello Chris,

Sorry, now that I checked for "contains()" evereything seems ok.
I cannot see my fault yet, but EL seems to work correctly.

So I've got to apologize,
Michael

Christopher Delahunt schrieb:
> Hello,
> 
> They should be merged.  Can you elaborate on why you believe they are not merged?  What does em.contains() on a member of the entries collection return after the merge (using the returned and managed Schedule of course).
> 
> Best Regards,
> Chris
> 
> 
> ----- Original Message -----
> From: michael.simons@xxxxxxxxxxx
> To: eclipselink-users@xxxxxxxxxxx
> Sent: Wednesday, December 30, 2009 8:35:22 AM GMT -05:00 US/Canada Eastern
> Subject: [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
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 



Back to the top