-
Notifications
You must be signed in to change notification settings - Fork 132
SimpleR2dbcRepository does not support custom subclasses #416
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
Labels
type: bug
A general bug
Milestone
Comments
Waiting for #368. |
mp911de
added a commit
that referenced
this issue
Aug 4, 2020
mp911de
added a commit
that referenced
this issue
Aug 4, 2020
@duke9509 as a temporary workaround you can always use the second constructor with null value for ReactiveDataAccessStrategy
I've checked - it's working. SimpleR2dbcRepository ignores it anyway
|
@dkublik You know... I am kind of embarrassed that I didn't think of that, haha. Thank you very much! 😂 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This section of the Spring Data Reference Documentation describes how a custom repository base class can be used.
It notes that, when doing so, one must override/provide a constructor with the signature
(EntityInformation<T, ID>, StoreOperations, ...)
.In the case of
SimpleR2dbcRepository
, that would beSimpleR2dbcRepository(RelationalEntityInformation<T, ID>, R2dbcEntityOperations, R2dbcConverter)
. However, that constructor is package-private.Attempting to override the public constructor yields an error on bean instantiation saying to provide the other signature. It is also not possible to convert from the desired signature to the public one, as there does not appear to be a publicly-accessible way to pull the
ReactiveDataAccessStrategy
back out of theR2dbcEntityOperations
(The trick theR2dbcEntityTemplate
constructor uses to pull it out of theDatabaseClient
won't work asDefaultDatabaseClient
is also package-private).Is there a particular reason that constructor is package-private? The fact that it is seems to me to be the only thing preventing the use of a custom base class. Or is there something else I'm missing?
The text was updated successfully, but these errors were encountered: