-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support redis specific repository. #2816
Comments
This is by design to avoid having another empty store-specific interface. Let me know how this goes. |
Of course, as you say, there is a way to use annotations, but according to the reference documentation, a module-based repository should also be provided. However, in the current implementation, there is no repository interface that is specific to Redis, so there are limited ways to utilize a module-based repository. So I created a mark interface that is simply an extension of KeyValueRepository. This interface is only utilized by Redis, so it is clearly distinguishable from other repositories. |
Over time, we've realized that introducing module-specific interface types are a harm to the desired programming model. Again, introducing empty marker interfaces do not improve such arrangements but they introduce technology-specific dependencies whereas Spring Data aims to create a store-independent experience in which calling code shouldn't be aware of the technology-specifics. |
Previously, we were only specifying
KeyValueRepository
as the IdentifyingTypes of the repository.This can be problematic when used with another implementation of KeyValueRepository,
so we need to provide a Redis-specific repository interface.
For example, if you have an implementation of a KeyValue named
AnotherKV
, as shown below,Spring Data will not be able to determine which datastore it should run to.
If Redis-specific repositories were added, this confusion could be eliminated.
By providing a module-specific repository, we can ensure that the repository is bound to a redis.
The text was updated successfully, but these errors were encountered: