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. */