-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: why is "delete-orphan" missing in JPA?
PostPosted: Fri Apr 13, 2007 5:19 am 
Newbie

Joined: Thu Mar 24, 2005 6:32 am
Posts: 4
Hi,

I am evaluating different JPA implementations and wonder about "delete-orphan" feature. Seems that all major pre-JPA ORM frameworks (hibernate, kodo, toplink, jdo) recognized need for such a feature.

Despite existing experience, the feature is missing in JPA spec, effectivelly breaking Rich Domain Model idea (any method possibly deleting an object needs an EntityManager instance).

This is in sharp conflict with EntityManager planned use (EntityManager is meant for use out of managed environment as well).
Please, can someone explain me what arguments had JPA commitee?
Exist any links which could help me understand situation in this area?

thanks martin


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 5:51 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
delete-orphan is a bad hack that does not fit into the entity lifecycle model. An entity instance supports shared references, just because a single reference (pointer) to it is removed, doesn't mean the persistence service can go ahead and remove the instance.

Note that I'm not saying it's a useless hack.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 7:42 am 
Newbie

Joined: Thu Mar 24, 2005 6:32 am
Posts: 4
Thanks, Christian, despite I can not say You helped me :-D.
Please, what nice hack i am supposed to use instead of the bad one, in order to comply with entity lifecycle model?
I hope there is one.

I insist "delete-orphan" is "mus-have" feature. If JPA entity lifecycle does not support it, then JPA is IMHO wrong. Without this feature it is not possible:
a) modify a detached object (if modification results in some deletions)
b) use Rich Domain Object (unless all my business methods/objects are infected with EntityManager)
(pls correct me if i'm wrong)

If i put it short JPA commitee is wrong as entity lifecycle does not calculate with child entity deletion?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.