Cleanup: Consistently use Configuration#family()

Use `Configuration#family()` and `Scope#family()` whenever possible
rather than the corresponding `dialect()` method.
This commit is contained in:
Knut Wannheden 2019-09-17 14:11:45 +02:00
parent 85ddf1f4d9
commit b4af3ab133
4 changed files with 7 additions and 11 deletions

View File

@ -112,11 +112,9 @@ final class RowCondition extends AbstractCondition {
}
private final QueryPartInternal delegate(Configuration configuration) {
SQLDialect dialect = configuration.dialect();
// Regular comparison predicate emulation
if ((comparator == EQUALS || comparator == NOT_EQUALS) &&
EMULATE_EQ_AND_NE.contains(dialect.family())) {
EMULATE_EQ_AND_NE.contains(configuration.family())) {
Field<?>[] leftFields = left.fields();
Field<?>[] rightFields = right.fields();
@ -135,7 +133,7 @@ final class RowCondition extends AbstractCondition {
// Ordering comparison predicate emulation
else if ((comparator == GREATER || comparator == GREATER_OR_EQUAL || comparator == LESS || comparator == LESS_OR_EQUAL) &&
EMULATE_RANGES.contains(dialect.family())) {
EMULATE_RANGES.contains(configuration.family())) {
// The order component of the comparator (stripping the equal component)
Comparator order

View File

@ -137,7 +137,7 @@ final class RowOverlapsCondition<T1, T2> extends AbstractCondition {
}
// These dialects seem to have trouble with INTERVAL OVERLAPS predicates
else if (intervalOverlaps && EMULATE_INTERVAL_OVERLAPS .contains(configuration.dialect())) {
else if (intervalOverlaps && EMULATE_INTERVAL_OVERLAPS.contains(configuration.family())) {
return (QueryPartInternal)
right1.le(left1.add(left2)).and(
left1.le(right1.add(right2)));

View File

@ -1127,8 +1127,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
*/
@SuppressWarnings("unchecked")
private final void toSQLReference0(Context<?> context, Field<?>[] originalFields, Field<?>[] alternativeFields) {
SQLDialect dialect = context.dialect();
SQLDialect family = dialect.family();
SQLDialect family = context.family();
boolean qualify = context.qualify();
int unionOpSize = unionOp.size();
@ -1490,7 +1489,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
// -------------
context.start(SELECT_WINDOW);
if (Tools.isNotEmpty(window) && dialect.supports(SUPPORT_WINDOW_CLAUSE)) {
if (Tools.isNotEmpty(window) && context.dialect().supports(SUPPORT_WINDOW_CLAUSE)) {
context.formatSeparator()
.visit(K_WINDOW)
.sql(' ')
@ -1520,7 +1519,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
for (Select<?> other : union.get(i)) {
context.formatSeparator()
.visit(op.toKeyword(dialect))
.visit(op.toKeyword(family))
.sql(' ');
unionParenthesis(context, '(', other.getSelect().toArray(EMPTY_FIELD));

View File

@ -2201,8 +2201,7 @@ final class Tools {
// [#1593] Create a dummy renderer if we're in bind mode
if (render == null) render = new DefaultRenderContext(bind.configuration());
SQLDialect dialect = render.dialect();
SQLDialect family = dialect.family();
SQLDialect family = render.family();
boolean mysql = SUPPORT_MYSQL_SYNTAX.contains(family);
char[][][] quotes = QUOTES.get(family);