-
Notifications
You must be signed in to change notification settings - Fork 131
Description
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 be SimpleR2dbcRepository(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 the R2dbcEntityOperations
(The trick the R2dbcEntityTemplate
constructor uses to pull it out of the DatabaseClient
won't work as DefaultDatabaseClient
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?