[#5272] Add SQLDialect.supports(SQLDialect)
This commit is contained in:
parent
7c55125253
commit
4ff2c39776
@ -462,6 +462,30 @@ public enum SQLDialect {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether this dialect supports another one.
|
||||
* <p>
|
||||
* This is:
|
||||
* <ul>
|
||||
* <li><code>false</code> if dialects don't belong to the same family</li>
|
||||
* <li><code>true</code> if either dialect {@link #isFamily()}</li>
|
||||
* <li><code>true</code> if <code>other</code> dialect precedes this
|
||||
* dialect</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* The <code>other</code> 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.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user