We have a scenario where we need to override the region-name at runtime. Based on replies from stackoverflow, we were able to override the getRegionName in a custom Gemfire Template after overriding the repositoryBaseClass.
While this works for the queries based on SimpleGemfireRepository, we're unable to override the region-names in the the findBy/@Query repository methods. Based on code-walkthrough, we have identified the StringBasedGemfireGemfireRepositoryQuery class - execute method where post the queryCreation, we will be able to do a string-replace based on custom logic.
Is there a possibility to have a method-hook (say customizeGeneratedQuery()) which can be called and there is no default behavior. But custom implementations can override this method to accomplish the feature. I'm looking at an option to enable bean-injection as prototype. But if there is an alternative/best-practice, that'll be interesting.
The other way, to create our own Query implementation causes a lot of code duplication and forces us to use the org.springframework package in our code as few methods have default access.