[
https://issues.apache.org/jira/browse/CAY-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190460#comment-13190460
]
Andrus Adamchik commented on CAY-1616:
--------------------------------------
After reviewing the patches, I decided to go a different way... The solution
originally suggested in this Jira and implemented by Dzmitri was logical, but
unfortunately too invasive. Also noticed a few places in the patch breaking
separation of concerns (client classes implementing interface from access
package, which is not available in ROP... not that it is documented anywhere
:-)).
Anyways, per r1234358 "turns out all non-merge versions of the old localObject
call are done on DataContext, not on generic ObjectContext, and are scoped
inside access package. So I just created a package private method for this
case" ...
Now we are down to just 2 calls of localObject (the merging variety) + a bunch
of unit tests. Will see what we can do with those.
> Remove internal dependencies on deprecated ObjectContext.localObject
> --------------------------------------------------------------------
>
> Key: CAY-1616
> URL: https://issues.apache.org/jira/browse/CAY-1616
> Project: Cayenne
> Issue Type: Task
> Components: Core Library
> Affects Versions: 3.1M3
> Reporter: Andrus Adamchik
> Assignee: Andrus Adamchik
> Attachments: cross-context-mapping-strategy-implementation.patch,
> cross-context-mapping-strategy-unit-tests.patch,
> cross-context-mappingstrategy-switching.patch
>
>
> CAY-1611 introduces user-facing API for obtaining context-local objects.
> Still Cayenne internals keep using the old deprecated localObject(ObjectId,
> Persistent) method in many places. We need to create a replacement. For a
> replacement I am looking at binding a new DI service similar to this:
> CrossContextMappingStrategy
> Persistent locateInContext(ObjectId id);
> Persistent locateInChildContext(Persistent parentContextObject);
>
> From there it will all be about figuring a way to inject
> CrossContextMappingStrategy in various places where 'localObject' is used
> currently. Also possibly BaseContext should use the first method for its
> 'localObject' implementation.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira