[#3565] Add XXXContext.settings() for convenience
This commit is contained in:
parent
9db1cb40b6
commit
859680998e
@ -67,6 +67,14 @@ public interface Context<C extends Context<C>> {
|
||||
*/
|
||||
Configuration configuration();
|
||||
|
||||
/**
|
||||
* The settings wrapped by this context.
|
||||
* <p>
|
||||
* This method is a convenient way of accessing
|
||||
* <code>configuration().settings()</code>.
|
||||
*/
|
||||
Settings settings();
|
||||
|
||||
/**
|
||||
* The {@link SQLDialect} wrapped by this context.
|
||||
* <p>
|
||||
|
||||
@ -43,6 +43,7 @@ package org.jooq;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.jooq.conf.Settings;
|
||||
import org.jooq.exception.DataAccessException;
|
||||
|
||||
/**
|
||||
@ -68,6 +69,14 @@ public interface DAO<R extends TableRecord<R>, P, T> {
|
||||
*/
|
||||
Configuration configuration();
|
||||
|
||||
/**
|
||||
* The settings wrapped by this context.
|
||||
* <p>
|
||||
* This method is a convenient way of accessing
|
||||
* <code>configuration().settings()</code>.
|
||||
*/
|
||||
Settings settings();
|
||||
|
||||
/**
|
||||
* The {@link SQLDialect} wrapped by this context.
|
||||
* <p>
|
||||
|
||||
@ -123,6 +123,14 @@ public interface DSLContext {
|
||||
*/
|
||||
Configuration configuration();
|
||||
|
||||
/**
|
||||
* The settings wrapped by this context.
|
||||
* <p>
|
||||
* This method is a convenient way of accessing
|
||||
* <code>configuration().settings()</code>.
|
||||
*/
|
||||
Settings settings();
|
||||
|
||||
/**
|
||||
* The {@link SQLDialect} wrapped by this context.
|
||||
* <p>
|
||||
|
||||
@ -115,6 +115,14 @@ public interface ExecuteContext {
|
||||
*/
|
||||
Configuration configuration();
|
||||
|
||||
/**
|
||||
* The settings wrapped by this context.
|
||||
* <p>
|
||||
* This method is a convenient way of accessing
|
||||
* <code>configuration().settings()</code>.
|
||||
*/
|
||||
Settings settings();
|
||||
|
||||
/**
|
||||
* The {@link SQLDialect} wrapped by this context.
|
||||
* <p>
|
||||
|
||||
@ -42,6 +42,8 @@ package org.jooq;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.jooq.conf.Settings;
|
||||
|
||||
/**
|
||||
* A context object for {@link Record} manipulation passed to registered
|
||||
* {@link RecordListener}'s.
|
||||
@ -105,6 +107,14 @@ public interface RecordContext {
|
||||
*/
|
||||
Configuration configuration();
|
||||
|
||||
/**
|
||||
* The settings wrapped by this context.
|
||||
* <p>
|
||||
* This method is a convenient way of accessing
|
||||
* <code>configuration().settings()</code>.
|
||||
*/
|
||||
Settings settings();
|
||||
|
||||
/**
|
||||
* The {@link SQLDialect} wrapped by this context.
|
||||
* <p>
|
||||
|
||||
@ -40,6 +40,8 @@
|
||||
*/
|
||||
package org.jooq;
|
||||
|
||||
import org.jooq.conf.Settings;
|
||||
|
||||
/**
|
||||
* A context object that is used to pass arguments to the various methods of
|
||||
* {@link TransactionProvider}.
|
||||
@ -53,6 +55,14 @@ public interface TransactionContext {
|
||||
*/
|
||||
Configuration configuration();
|
||||
|
||||
/**
|
||||
* The settings wrapped by this context.
|
||||
* <p>
|
||||
* This method is a convenient way of accessing
|
||||
* <code>configuration().settings()</code>.
|
||||
*/
|
||||
Settings settings();
|
||||
|
||||
/**
|
||||
* The {@link SQLDialect} wrapped by this context.
|
||||
* <p>
|
||||
|
||||
@ -42,6 +42,8 @@ package org.jooq;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.jooq.conf.Settings;
|
||||
|
||||
/**
|
||||
* A context object for {@link QueryPart} traversal passed to registered
|
||||
* {@link VisitListener}'s.
|
||||
@ -94,6 +96,14 @@ public interface VisitContext {
|
||||
*/
|
||||
Configuration configuration();
|
||||
|
||||
/**
|
||||
* The settings wrapped by this context.
|
||||
* <p>
|
||||
* This method is a convenient way of accessing
|
||||
* <code>configuration().settings()</code>.
|
||||
*/
|
||||
Settings settings();
|
||||
|
||||
/**
|
||||
* The {@link SQLDialect} wrapped by this context.
|
||||
* <p>
|
||||
|
||||
@ -63,6 +63,7 @@ import org.jooq.VisitContext;
|
||||
import org.jooq.VisitListener;
|
||||
import org.jooq.VisitListenerProvider;
|
||||
import org.jooq.conf.ParamType;
|
||||
import org.jooq.conf.Settings;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
@ -245,6 +246,11 @@ abstract class AbstractContext<C extends Context<C>> implements Context<C> {
|
||||
return AbstractContext.this.configuration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Settings settings() {
|
||||
return Utils.settings(configuration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SQLDialect dialect() {
|
||||
return Utils.configuration(configuration()).dialect();
|
||||
@ -316,6 +322,11 @@ abstract class AbstractContext<C extends Context<C>> implements Context<C> {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Settings settings() {
|
||||
return Utils.settings(configuration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SQLDialect dialect() {
|
||||
return Utils.configuration(configuration()).dialect();
|
||||
|
||||
@ -280,6 +280,11 @@ public class DefaultDSLContext implements DSLContext, Serializable {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Settings settings() {
|
||||
return Utils.settings(configuration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SQLDialect dialect() {
|
||||
return Utils.configuration(configuration()).dialect();
|
||||
|
||||
@ -68,6 +68,7 @@ import org.jooq.ResultQuery;
|
||||
import org.jooq.Routine;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.Update;
|
||||
import org.jooq.conf.Settings;
|
||||
import org.jooq.tools.jdbc.JDBCUtils;
|
||||
|
||||
/**
|
||||
@ -411,6 +412,11 @@ class DefaultExecuteContext implements ExecuteContext {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Settings settings() {
|
||||
return Utils.settings(configuration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SQLDialect dialect() {
|
||||
return Utils.configuration(configuration()).dialect();
|
||||
|
||||
@ -49,6 +49,7 @@ import org.jooq.Record;
|
||||
import org.jooq.RecordContext;
|
||||
import org.jooq.RecordType;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.conf.Settings;
|
||||
|
||||
/**
|
||||
* A default implementation for {@link RecordContext}.
|
||||
@ -90,6 +91,11 @@ class DefaultRecordContext implements RecordContext {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Settings settings() {
|
||||
return Utils.settings(configuration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SQLDialect dialect() {
|
||||
return Utils.configuration(configuration()).dialect();
|
||||
|
||||
@ -44,6 +44,7 @@ import org.jooq.Configuration;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.Transaction;
|
||||
import org.jooq.TransactionContext;
|
||||
import org.jooq.conf.Settings;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
@ -63,6 +64,11 @@ class DefaultTransactionContext implements TransactionContext {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Settings settings() {
|
||||
return Utils.settings(configuration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SQLDialect dialect() {
|
||||
return Utils.configuration(configuration()).dialect();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user