You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to add a single method to all of the repositories declared in your app, you need to follow a 3 step process, e.g. described in the documentation.
Step three is rather awkward and effectively only necessary as we don't know about the exact arguments necessary to construct the store specific factory instance. If implementors provided the arguments and we assume that users stick to exactly that list of arguments (probably a very reasonable assumption) we could add an additional way of customizing the instantiation by exposing a configuration property repositoryBaseClass and reflectively instantiate that one instead of calling the template methods.
Changes required:
a setter to configure the repository base class on RepositoryFactorySupport
a template method to let implementors provide constructor arguments for the reflective invocation
change the behavior of RepositoryFactorySupport.getRepository(…) to prefer the configured type over triggering the repository creation in subclasses.
expose configuration means in @Enable…Repositories and XML namespace (will require changes to store implementations as well)
Optional changes:
improve the naming of the methods in RepositoryFactorySupport as what's currently called getTargetRepository will become more of a default repository target (used if nothing special is configured)
Issue Links:
DATACASS-214 Adapt API to API changes in Spring Data Commons
("is depended on by")
DATAJPA-674 Problems following the documentation for adding custom behaviour to all repositories
DATACASS-211 Adapt to changes in Spring Data Commons
DATAES-162 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
DATAGRAPH-617 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
DATAJPA-710 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
DATAMONGO-1211 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
The text was updated successfully, but these errors were encountered:
Oliver Drotbohm opened DATACMNS-542 and commented
If you want to add a single method to all of the repositories declared in your app, you need to follow a 3 step process, e.g. described in the documentation.
Step three is rather awkward and effectively only necessary as we don't know about the exact arguments necessary to construct the store specific factory instance. If implementors provided the arguments and we assume that users stick to exactly that list of arguments (probably a very reasonable assumption) we could add an additional way of customizing the instantiation by exposing a configuration property
repositoryBaseClass
and reflectively instantiate that one instead of calling the template methods.Changes required:
RepositoryFactorySupport
RepositoryFactorySupport.getRepository(…)
to prefer the configured type over triggering the repository creation in subclasses.@Enable…Repositories
and XML namespace (will require changes to store implementations as well)Optional changes:
RepositoryFactorySupport
as what's currently calledgetTargetRepository
will become more of a default repository target (used if nothing special is configured)Issue Links:
DATACASS-214 Adapt API to API changes in Spring Data Commons
("is depended on by")
DATAJPA-674 Problems following the documentation for adding custom behaviour to all repositories
DATACASS-211 Adapt to changes in Spring Data Commons
DATAES-162 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
DATAGRAPH-617 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
DATAJPA-710 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
DATAMONGO-1211 Adapt API changes in Spring Data Commons to simplify custom repository base class registration
The text was updated successfully, but these errors were encountered: