-->
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.  [ 1 post ] 
Author Message
 Post subject: Best practices for finding + removing references to objects?
PostPosted: Thu Sep 11, 2008 5:52 am 
Newbie

Joined: Thu Sep 11, 2008 5:08 am
Posts: 1
Consider the following scenario where we have three objects (B,C,D)
referring to object A.

Code:
@Entity
class A {
}

@Entity
class B {
     private List<A> a;
}

@Entity
class C {
     private List<A> a;
}

@Entity
class D {
     private A a;
}



Suppose I would like to remove an A instance using
Code:
entityManager.remove(a);

This means that I have to first remove all references from B and C to my a instance otherwise the removal will fail. With D I would have to set a == null or remove the D instance.

What I want to know is if there are any best practices, patterns or even some hibernate support for this that I am unaware of?

Kind regards

/Johan


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

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.