The problem became evident while working on the following PR #2024.
We have a Dialect interface abstraction, that resides in the relational module. That makes sense, since several capabilities can be re-used in both jdbc and r2dbc modules. We then have a common dialects (that also reside in the relational module) like PostgresDialect or H2Dialect.
For r2dbc, there is no problem - we have a separate PostgresDialect class, that resides in the r2dbc (!) module, and that extends the PostgresDialect in relational module. Therefore, the r2dbc's PostgresDialect can use all the features that reside in the r2dbc module, as it should.
In case of jdbc - we have a problem. The dialects that we use in jdbc module are really placed in the relational module. That becomes a big deal, when we want (and we probably should want) to use some jdbc specific functionality (like java.sql.SQLType) in the dialect that is supposed to be used in spring-data-jdbc.
Soltuion: the way the dialecfts are now structured in r2dbc is the right way to go in my opinion, and in jdbc module we should not use the dialects in relational module, we should provide classes that extend them in the jdbc module, so we can allow these dialects to use jdbc-specific features.
The problem became evident while working on the following PR #2024.
We have a
Dialectinterface abstraction, that resides in the relational module. That makes sense, since several capabilities can be re-used in bothjdbcandr2dbcmodules. We then have a common dialects (that also reside in therelationalmodule) likePostgresDialectorH2Dialect.For
r2dbc, there is no problem - we have a separatePostgresDialectclass, that resides in ther2dbc(!) module, and that extends thePostgresDialectinrelationalmodule. Therefore, ther2dbc'sPostgresDialectcan use all the features that reside in the r2dbc module, as it should.In case of
jdbc- we have a problem. The dialects that we use injdbcmodule are really placed in therelationalmodule. That becomes a big deal, when we want (and we probably should want) to use somejdbcspecific functionality (likejava.sql.SQLType) in the dialect that is supposed to be used inspring-data-jdbc.Soltuion: the way the dialecfts are now structured in
r2dbcis the right way to go in my opinion, and injdbcmodule we should not use the dialects inrelationalmodule, we should provide classes that extend them in thejdbcmodule, so we can allow these dialects to use jdbc-specific features.