Hi all,
I have been working on CMP 2.x relationships and I finally have the
degenerate monkey case working, one-to-one unidirectional. It is the
uninteresting case and a monkey could have coded it (of course it took me a
day and a half). Any way, I started with this case to give me a feeling for
how difficult the rest of the cases would be, and it helped me identify the
following problem.
PROBLEM:
In the core of the CMR (Container Managed Relation) field, I have the pk of
the related entity, and I need to operate on the related entity's data. So I
need the EntityEnterpriseContext (ctx) object for the related (and I only
have the pk), because all of the data for the entity is stored in
ctx.getPersistenceContext(). The only way I can find to get a ctx for a pk
is from EntityInstanceInterceptor, and the only way to get to the
EntityInstanceInterceptor is container.invoke(mi).
PROPOSED SOLUTION:
I will create a new interceptor for relationships. In the CMR code when I
need to operate on related object's data, I will send a 'message' to the
related persistence store via the interceptor chain, and the last
interceptor (mine) will catch the 'message' and have the related persistence
store perform the necessary operation.
PLEASE RESPOND:
If you know of another way to do this or if this is a bad idea, please speak
up now. My understanding of the intricacies of the container is very
limited, and I'm afraid my proposed solution may create a funky problem for
the system. Any response would be appreciated (even if it's 'yep that's
cool').
Thanks,
Dain Sundstrom
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development