Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] @PrivateOwned is not deleting records in one-to-many (unidirectional) join table

I think this issue was fixed, you can try the latest release.

Otherwise, try removing the cascade all (or at least cascade remove), this
should resolve the issue.

You could also remove the children from the collection, call flush, then
delete the objects.


Venkateswara Rao Alla wrote:
> 
> I've problem with @PrivateOwned as it is not deleting the mapping records
> in
> the Join table for an unidirectional one-to-many association (to be
> specific, this one-to-many association is a self one, meaning to the same
> table)
> 
> Below is the config I'm using
> 
> @Entity
> @Table("CONTERM")
> public class Contract extends BasicEntity {
>  private String name;
>  @OneToOne
> @JoinColumn(name="PARENT_ID", referencedColumnName="ID")
> private Contract parent;
>  @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
> @PrivateOwned
> private List<Contract> child;
>         .....
> }
> 
> Deletes for the child records were issued, but failed to delete the join
> table rows and giving constraint error.
> 
> com.ibm.db2.jcc.am.fo: DB2 SQL Error: SQLCODE=-532, SQLSTATE=23504,
> SQLERRMC=DB2USR.CONTERM_CONTERM.FK_CONTERM_CONTERM_CHILD_ID,
> DRIVER=3.57.82
> at com.ibm.db2.jcc.am.bd.a(bd.java:672)
> at com.ibm.db2.jcc.am.bd.a(bd.java:60)
> at com.ibm.db2.jcc.am.bd.a(bd.java:127)
> 
> I am using EclipseLink1.1 & DB2 v9.7
> 
> Thanks for any info.
> 
> Venki
> 
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/%40PrivateOwned-is-not-deleting-records-in-one-to-many-%28unidirectional%29-join-table-tp29759309p29773030.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top