[jOOQ/jOOQ#12737] DataType.isSpatial() is a commercial feature

This commit is contained in:
Lukas Eder 2021-12-15 08:29:46 +01:00
parent ddc9762698
commit 97c455e748
3 changed files with 26 additions and 11 deletions

View File

@ -1053,8 +1053,13 @@ public interface DataType<T> extends Named {
*/
boolean isXML();
/**
* Whether this data type is a spatial type.
*/
boolean isSpatial();
}

View File

@ -755,11 +755,15 @@ implements
return tType0() == XML.class;
}
@Override
public final boolean isSpatial() {
Class<?> tType = tType0();
return tType == Geometry.class || tType == Geography.class;
}
@Override
public final void accept(Context<?> ctx) {

View File

@ -745,7 +745,11 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
}
// [#7242] Other vendor specific types also need a lot of casting
if (dataType.isJSON() || dataType.isSpatial()) {
if (dataType.isJSON()
) {
switch (ctx.family()) {
@ -818,7 +822,9 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
(sqlDataType == null ||
(!sqlDataType.isTemporal()
&& sqlDataType != SQLDataType.UUID
&& !sqlDataType.isSpatial()
&& !sqlDataType.isJSON())))
sql(ctx, converted);