Polishing.
Reuse H2 dialect settings in R2DBC-specific H2 dialect. Refactor ArrayColumns support classes, into toplevel-types. Let R2DBC H2 sublass the relational H2Dialect to decouple from Postgres. See #1287 Original pull request #1297
This commit is contained in:
committed by
Jens Schauder
parent
c2e163b5c2
commit
0d1ba211c5
@@ -23,19 +23,14 @@ import org.springframework.data.relational.core.dialect.ArrayColumns;
|
||||
* {@link org.springframework.data.relational.core.dialect.ArrayColumns} that offer JDBC-specific functionality.
|
||||
*
|
||||
* @author Jens Schauder
|
||||
* @author Mark Paluch
|
||||
* @since 2.3
|
||||
*/
|
||||
public interface JdbcArrayColumns extends ArrayColumns {
|
||||
|
||||
@Override
|
||||
default Class<?> getArrayType(Class<?> userType) {
|
||||
|
||||
Class<?> componentType = userType;
|
||||
while (componentType.isArray()) {
|
||||
componentType = componentType.getComponentType();
|
||||
}
|
||||
|
||||
return componentType;
|
||||
return ArrayColumns.unwrapComponentType(userType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,11 +38,11 @@ public class JdbcPostgresDialect extends PostgresDialect implements JdbcDialect
|
||||
return ARRAY_COLUMNS;
|
||||
}
|
||||
|
||||
static class JdbcPostgresArrayColumns extends PostgresArrayColumns implements JdbcArrayColumns {
|
||||
static class JdbcPostgresArrayColumns implements JdbcArrayColumns {
|
||||
|
||||
@Override
|
||||
public Class<?> getArrayType(Class<?> userType) {
|
||||
return JdbcArrayColumns.super.getArrayType(userType);
|
||||
public boolean isSupported() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user