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: + *
false if dialects don't belong to the same familytrue if either dialect {@link #isFamily()}true if other dialect precedes this
+ * dialect
+ * 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.
*/