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
The inferred limit parameter type here is Int64, while YDB requires it to be exaclty UInt64.
There are other cases where implicit type conversion fails. So a way to control this behavior would be great. An existing @YdbType annotation seems like a good solution.
@mipo256 The annotation is currently only applicable to fields. Placing it on method parameter will result in a compilation error.
The issue has nothing to do with configuration.
The first top-level review of the problem unravels the following approach.
We can specify the custom RepositoryFactoryBeanSupport in the @EnableJdbcRepositories, extended from JdbcRepositoryFactoryBean likely. We need it to override the creation of the JdbcRepositoryFactory child that has it's own QueryLookupStrategy defined. And here, we can construct our own QueryMethod with our own implementation of getParameters().
That would solve the problem. However, there are a couple of caveats.
This would require to extend a lot of stuff from the original Spring Data Commons/Spring Data JDBC infrastructure. That is generally not a big deal, since it is designed in this way specifically
The larger problem is that the JdbcQueryLookupStrategy that is native to Spring Data JDBC, like CreateIfNotFoundQueryLookupStrategy, which is used by default, is not a public API. Therefore, we would have to extend RelationalQueryLookupStrategy and duplicate some code from the original source tree.
UPDATE: After discussion with Spring Data team: The corresponding Spring Data JDBC change would be introduced in 4.0.x major release. When this will be done, we'll be able to implement this feature.
UPDATE: After discussion with Spring Data team: The corresponding Spring Data JDBC change would be introduced in 4.0.x major release. When this will be done, we'll be able to implement this feature.
Activity
mipo256 commentedon Feb 17, 2025
@zdazzy Existing
YdbMappingJdbcConverter
should solve this. This customJdbcConverter
is applied on both named and positional parameters.Have you extended the
AbstractYdbJdbcConfiguration
?zdazzy commentedon Feb 20, 2025
@mipo256 The annotation is currently only applicable to fields. Placing it on method parameter will result in a compilation error.
The issue has nothing to do with configuration.
mipo256 commentedon Feb 21, 2025
Yes, I got the general idea of what you're trying to do.
CC: @KirillKurdyukov please, add the
pending-design
tag for the issuemipo256 commentedon Feb 21, 2025
The first top-level review of the problem unravels the following approach.
We can specify the custom
RepositoryFactoryBeanSupport
in the@EnableJdbcRepositories
, extended fromJdbcRepositoryFactoryBean
likely. We need it to override the creation of theJdbcRepositoryFactory
child that has it's ownQueryLookupStrategy
defined. And here, we can construct our ownQueryMethod
with our own implementation ofgetParameters()
.That would solve the problem. However, there are a couple of caveats.
JdbcQueryLookupStrategy
that is native to Spring Data JDBC, likeCreateIfNotFoundQueryLookupStrategy
, which is used by default, is not a public API. Therefore, we would have to extendRelationalQueryLookupStrategy
and duplicate some code from the original source tree.So, we need to think about it more deeply.
CC: @KirillKurdyukov
mipo256 commentedon Feb 21, 2025
Related spring-projects/spring-data-relational#1998
mipo256 commentedon Mar 14, 2025
UPDATE: After discussion with Spring Data team: The corresponding Spring Data JDBC change would be introduced in 4.0.x major release. When this will be done, we'll be able to implement this feature.
CC: @zdazzy @KirillKurdyukov
KirillKurdyukov commentedon Mar 17, 2025
Thanks Misha!
ydb-platformGH-173 Added custom YdbRepositoryFactory infrastructure
1 remaining item