| Summary: | Cascade persist on child with joined table fails | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | John Howard <john.howard9> |
| Component: | Eclipselink | Assignee: | Project Inbox <eclipselink.orm-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | tom.ware |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
@Entity @Table(name = "ENTITY_A") Class A { @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "B_FK") // @Transient private B b; } @Entity @DiscriminatorValue(value = "Y") @PrimaryKeyJoinColumn(name = "C_PK") @Table(name = "ENTITY_B") Class B extends Class C { } @Entity @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "TYPE_IND") @DiscriminatorValue(value = "N") @Table(name = "ENTITY_C") Class C { @Id @GeneratedValue(generator = "ECLIPSELINK_SEQUENCE") @SequenceGenerator(name = "ECLIPSELINK_SEQUENCE", sequenceName = "ECLIPSELINK_SEQUENCE", allocationSize = 200) @Column(name = "C_PK") private Long id; } Persisting A appears to work but subsequent flushes result in EclipseLink-4002 integrity constraint violated - parent key not found This code worked in EclipseLink 2.0.2 There is a work around, which is to persist B before persisting A.