openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Leisenberg <jens.leisenb...@de.ibm.com>
Subject Re: OneToMany Delete Order Problem
Date Thu, 20 Jun 2013 07:58:30 GMT
Josh,

did you tried to set the ShemaFactory property in your persistence.xml to
'native(ForeignKeys=true)'? This should reorder the statements.

http://ci.apache.org/projects/openjpa/2.1.x/manual/ref_guide_schema_info.html#ref_guide_schema_info_factory



From:	"josh.wilson" <josh.wilson@inspiredbyte.com>
To:	users@openjpa.apache.org,
Date:	06/18/2013 07:19 PM
Subject:	OneToMany Delete Order Problem



I have a unidirectional one to many relationship defined but I am getting a
foreign key constraint violation when attempting to run a delete on the
entity.  It appears the delete statements are not being issued in the
correct order.  The entity record is being deleted before the records with
the foreign key references.

Is there any way to get them ordered properly?  Configuration details
follow..

OpenJPA 2.2.1-SNAPSHOT (Websphere Version)

Annotations on entity field

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER,
orphanRemoval
= true)
@JoinColumn(name = "ID_XXX", referencedColumnName = "ID_XXX", nullable =
false)







--
View this message in context:
http://openjpa.208410.n2.nabble.com/OneToMany-Delete-Order-Problem-tp7584211.html

Sent from the OpenJPA Users mailing list archive at Nabble.com.




Mime
View raw message