Thanks! This really a smart way for relations that often changes.
But I wonder if this is the only way?

What if the relation seldom change?
I believe the cost of the indirection will be shown on
the complexity of code and the runtime performance,
if using the "resolution" Entity everywhere.

On 1月20日, 下午3時37分, John Patterson <jdpatter...@gmail.com> wrote:
> If you are going to change the relation often you might want to have a  
> "resolution" Entity in the middle - lets say CurrentB.
>
> A->CurrentB->B
>
> instead of updating every A just update the single CurrentB
>
> On 20 Jan 2010, at 14:05, Alan She wrote:
>
>
>
> > Assume I have two class A and B,
> > which is unidirection unowned many to one relationship. (A * ----> 1
> > B)
> > I store the Key of class B inside class A.
> > The code looks like this, (I am using JPA)
>
> > @Entity
> > public class A {
>
> >   �...@enumerated
> >    private Key bKey;
> > }
>
> > @Entity
> > public class B {
> > }
>
> > Both A and B instance of the same user are under the same entity
> > group.
>
> > When I need to delete B, lets say 'Bx'
> > any A that associate with 'Bx' is going to change the association to
> > 'By'.
>
> > I can do this by query and iterate update with low level API.
> > However, there might be a huge amount of A,
> > This will exceed the request time limit.
>
> > What's the best solution to solve this problem?
> > Thanks!!
> > --
> > You received this message because you are subscribed to the Google  
> > Groups "Google App Engine for Java" group.
> > To post to this group, send email to google-appengine-java@googlegroups.com
> > .
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en
> > .
-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.


Reply via email to