From 4ff2c39776c3296d4816e979db4f48fb593a5f20 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Fri, 13 May 2016 17:43:55 +0200 Subject: [PATCH] [#5272] Add SQLDialect.supports(SQLDialect) --- jOOQ/src/main/java/org/jooq/SQLDialect.java | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/SQLDialect.java b/jOOQ/src/main/java/org/jooq/SQLDialect.java index f51fa58f01..a915f5365e 100644 --- a/jOOQ/src/main/java/org/jooq/SQLDialect.java +++ b/jOOQ/src/main/java/org/jooq/SQLDialect.java @@ -462,6 +462,30 @@ public enum SQLDialect { return false; } + /** + * Check whether this dialect supports another one. + *

+ * This is: + *

+ *

+ * The other argument dialect is typically referenced from a + * {@link Support} annotation, whereas this dialect is the user dialect. + */ + public final boolean supports(SQLDialect other) { + if (family != other.family) + return false; + + if (isFamily() || other.isFamily()) + return true; + + return other.precedes(this); + } + /** * The name of this dialect as it appears in related class names. */