Description
John Blum opened DATAGEODE-257 and commented
It would be ideal if a Function bound, Spring Data Repository
took context into consideration when performing Repository
data access operations.
For instance, if an application-defined Repository
is injected into and used in an Apache Geode Function (perhaps a Function annotated with @GemfireFunction
in SDG's Function Annotation support), and if the associated Region of the Repository
matches when the Function is "executed" on a Region (with @OnRegion
), then the Repository
would operate on the "local" (possibly, "filtered") data set provided by the FunctionContext
.
One such test example exists here along with it's Function definition and Function execution.
However, there are many things that need to be considered carefully as not to adversely affect any existing functionality or behavior. Using Repositories
in Functions is quite common in practice. The following list, though not exhaustive, needs to be taken in consideration:
-
Repositories
with an@Region
annotation on theRepository
itself, or indirectly on the associated application domain object does not match theRegionFunctionContext
of the Region targeted Function execution. -
Functions executed via
@OnMember(s)
or@OnServer{s)
should be excluded. -
Repositories
defining raw OQL using the@Query
annotation need to be handled appropriately. -
Repositories
with "custom" implemented methods also need to be handled properly. -
???
Reference URL: https://jira.spring.io/browse/SGF-451