Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Using @PrivateOwned(@PrivateOwned)
Using @PrivateOwned [message #692714] Tue, 05 July 2011 01:25 Go to next message
Eclipse UserFriend
I have a Query "delete from AgentGroup a" . The entity Agentgroup 1:M
relation with agents . When I execute the query above the agents dont get
deleted and I get FK constraint error. Even when i use @PrivateOwned over
the collection of agents



Thanks
P
Re: Using @PrivateOwned [message #693508 is a reply to message #692714] Wed, 06 July 2011 11:57 Go to previous message
Eclipse UserFriend
Delete queries only operate on the class you execute it on - so only AgentGroup entities and any subclasses will be deleted. A JPA provider does not read in the objects being deleted in these builk delete/update or native SQL queries, and so cannot determine if there are any references that need to be removed. Any references to these entities will need to be cleaned up before you execute a delete query on AgentGroup; using delete SQL for the refering entities or an update to fix the relationships.

If you want private ownership to be respected or the delete to cascade over mappings, you will need to call remove on the entity instance rather then using a delete query.

Best Regards,
Chris
Previous Topic:Maven static weaving plugin
Next Topic:Stuck with Moxy getting started example
Goto Forum:
  


Current Time: Tue Jul 01 23:26:24 EDT 2025

Powered by FUDForum. Page generated in 0.05907 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top