From d5f5c9d8a2a38e5c4a4819f3d6204b7ae158bc92 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sat, 13 Nov 2021 14:19:42 +0100 Subject: [PATCH] [jOOQ/jOOQ#982] Add support for GIS extensions - Support ST_Distance, ST_GeometryType --- jOOQ/src/main/java/org/jooq/impl/DSL.java | 81 ++++++++ jOOQ/src/main/java/org/jooq/impl/Names.java | 2 + .../main/java/org/jooq/impl/ParserImpl.java | 16 ++ jOOQ/src/main/java/org/jooq/impl/QOM.java | 24 +++ .../main/java/org/jooq/impl/StDistance.java | 191 ++++++++++++++++++ .../java/org/jooq/impl/StGeometryType.java | 173 ++++++++++++++++ 6 files changed, 487 insertions(+) create mode 100644 jOOQ/src/main/java/org/jooq/impl/StDistance.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/StGeometryType.java diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 115a2ddaa6..6c48f35aa0 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -21277,6 +21277,87 @@ public class DSL { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/impl/Names.java b/jOOQ/src/main/java/org/jooq/impl/Names.java index 2568793fb7..bcf84b5fed 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Names.java +++ b/jOOQ/src/main/java/org/jooq/impl/Names.java @@ -430,8 +430,10 @@ final class Names { static final Name N_ST_ASTEXT = unquotedName("st_astext"); static final Name N_ST_CONTAINS = unquotedName("st_contains"); static final Name N_ST_CROSSES = unquotedName("st_crosses"); + static final Name N_ST_DISTANCE = unquotedName("st_distance"); static final Name N_ST_ENDPOINT = unquotedName("st_endpoint"); static final Name N_ST_EQUALS = unquotedName("st_equals"); + static final Name N_ST_GEOMETRYTYPE = unquotedName("st_geometrytype"); static final Name N_ST_GEOMFROMTEXT = unquotedName("st_geomfromtext"); static final Name N_ST_INTERSECTION = unquotedName("st_intersection"); static final Name N_ST_INTERSECTS = unquotedName("st_intersects"); diff --git a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java index 7c23b14b03..cc4e4791da 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java @@ -321,6 +321,8 @@ import static org.jooq.impl.DSL.square; // ... // ... // ... +// ... +// ... import static org.jooq.impl.DSL.stddevPop; import static org.jooq.impl.DSL.stddevSamp; import static org.jooq.impl.DSL.sum; @@ -7752,6 +7754,10 @@ final class DefaultParseContext extends AbstractScope implements ParseContext { + + + + @@ -8332,11 +8338,21 @@ final class DefaultParseContext extends AbstractScope implements ParseContext { + } + else if (parseFunctionNameIf("ST_DISTANCE") && requireProEdition()) { + + + } else if (parseFunctionNameIf("ST_ENDPOINT") && requireProEdition()) { + } + else if (parseFunctionNameIf("ST_GEOMETRYTYPE") && requireProEdition()) { + + + } else if (parseFunctionNameIf("ST_GEOMFROMTEXT") && requireProEdition()) { diff --git a/jOOQ/src/main/java/org/jooq/impl/QOM.java b/jOOQ/src/main/java/org/jooq/impl/QOM.java index 0268da3134..e207eebf3c 100644 --- a/jOOQ/src/main/java/org/jooq/impl/QOM.java +++ b/jOOQ/src/main/java/org/jooq/impl/QOM.java @@ -3672,6 +3672,30 @@ public final class QOM { + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/impl/StDistance.java b/jOOQ/src/main/java/org/jooq/impl/StDistance.java new file mode 100644 index 0000000000..255d7e8f08 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/StDistance.java @@ -0,0 +1,191 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jOOQ/src/main/java/org/jooq/impl/StGeometryType.java b/jOOQ/src/main/java/org/jooq/impl/StGeometryType.java new file mode 100644 index 0000000000..672b7e22cc --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/StGeometryType.java @@ -0,0 +1,173 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +