[#2362] Decouple org.jooq.impl.Executor from Configuration. Choose

composition over inheritance
This commit is contained in:
Lukas Eder 2013-03-30 18:04:00 +01:00
parent 0dc7f8ac37
commit 58d3979bec
22 changed files with 382 additions and 399 deletions

View File

@ -118,7 +118,7 @@ public abstract class AbstractDatabase implements Database {
@Override
public final SQLDialect getDialect() {
if (dialect == null) {
dialect = create().getDialect();
dialect = create().configuration().getDialect();
}
return dialect;

View File

@ -125,7 +125,7 @@ public class CUBRIDDatabase extends AbstractDatabase {
@Override
protected void loadForeignKeys(DefaultRelations relations) throws SQLException {
ConnectionProvider provider = create().getConnectionProvider();
ConnectionProvider provider = create().configuration().getConnectionProvider();
Connection connection = null;
try {

View File

@ -707,7 +707,7 @@ public abstract class BaseTest<
protected Executor create(Settings settings) {
Executor create = delegate.create(settings);
create.getExecuteListeners().add(new TestStatisticsListener());
create.configuration().getExecuteListeners().add(new TestStatisticsListener());
return create;
}

View File

@ -744,7 +744,7 @@ public class OracleTest extends jOOQAbstractTest<
return Routines.fGetOneCursor((UNumberArrayRecord) null);
}
else {
return Routines.fGetOneCursor(new UNumberArrayRecord(create(), array));
return Routines.fGetOneCursor(new UNumberArrayRecord(create().configuration(), array));
}
}
@ -859,7 +859,7 @@ public class OracleTest extends jOOQAbstractTest<
public void testOraclePipelinedFunctions() throws Exception {
// TODO [#1113] [#1119] Standalone calls to pipelined functions should
// be possible too
System.out.println(Routines.fPipelinedArray1(create()));
System.out.println(Routines.fPipelinedArray1(create().configuration()));
}
@Test
@ -870,91 +870,91 @@ public class OracleTest extends jOOQAbstractTest<
// Unnesting arrays
assertEquals(emptyList(),
create().select().from(table(new UNumberArrayRecord(create(), (Integer[]) null))).fetch(0));
create().select().from(table(new UNumberArrayRecord(create().configuration(), (Integer[]) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(new UNumberArrayRecord(create()))).fetch(0));
create().select().from(table(new UNumberArrayRecord(create().configuration()))).fetch(0));
assertEquals(asList(1),
create().select().from(table(new UNumberArrayRecord(create(), 1))).fetch(0));
create().select().from(table(new UNumberArrayRecord(create().configuration(), 1))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(new UNumberArrayRecord(create(), 1, 2))).fetch(0));
create().select().from(table(new UNumberArrayRecord(create().configuration(), 1, 2))).fetch(0));
// Unnesting tables
assertEquals(emptyList(),
create().select().from(table(new UNumberTableRecord(create(), (Integer[]) null))).fetch(0));
create().select().from(table(new UNumberTableRecord(create().configuration(), (Integer[]) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(new UNumberTableRecord(create()))).fetch(0));
create().select().from(table(new UNumberTableRecord(create().configuration()))).fetch(0));
assertEquals(asList(1),
create().select().from(table(new UNumberTableRecord(create(), 1))).fetch(0));
create().select().from(table(new UNumberTableRecord(create().configuration(), 1))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(new UNumberTableRecord(create(), 1, 2))).fetch(0));
create().select().from(table(new UNumberTableRecord(create().configuration(), 1, 2))).fetch(0));
// Unnesting arrays from functions
assertEquals(emptyList(),
create().select().from(table(fArrays1((UNumberArrayRecord) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fArrays1(new UNumberArrayRecord(create(), (Integer[]) null)))).fetch(0));
create().select().from(table(fArrays1(new UNumberArrayRecord(create().configuration(), (Integer[]) null)))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fArrays1(new UNumberArrayRecord(create())))).fetch(0));
create().select().from(table(fArrays1(new UNumberArrayRecord(create().configuration())))).fetch(0));
assertEquals(asList(1),
create().select().from(table(fArrays1(fArrays1(new UNumberArrayRecord(create(), 1))))).fetch(0));
create().select().from(table(fArrays1(fArrays1(new UNumberArrayRecord(create().configuration(), 1))))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(fArrays1(fArrays1(new UNumberArrayRecord(create(), 1, 2))))).fetch(0));
create().select().from(table(fArrays1(fArrays1(new UNumberArrayRecord(create().configuration(), 1, 2))))).fetch(0));
// Unnesting tables from functions
assertEquals(emptyList(),
create().select().from(table(fTables1((UNumberTableRecord) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fTables1(new UNumberTableRecord(create(), (Integer[]) null)))).fetch(0));
create().select().from(table(fTables1(new UNumberTableRecord(create().configuration(), (Integer[]) null)))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fTables1(new UNumberTableRecord(create())))).fetch(0));
create().select().from(table(fTables1(new UNumberTableRecord(create().configuration())))).fetch(0));
assertEquals(asList(1),
create().select().from(table(fTables1(fTables1(new UNumberTableRecord(create(), 1))))).fetch(0));
create().select().from(table(fTables1(fTables1(new UNumberTableRecord(create().configuration(), 1))))).fetch(0));
assertEquals(asList(1, 2),
create().select().from(table(fTables1(fTables1(new UNumberTableRecord(create(), 1, 2))))).fetch(0));
create().select().from(table(fTables1(fTables1(new UNumberTableRecord(create().configuration(), 1, 2))))).fetch(0));
// Retrieving arrays from functions
assertNull(fArrays1(create(), null));
assertNull(fArrays1(create().configuration(), null));
assertEquals(emptyList(),
fArrays1(create(), new UNumberArrayRecord(create(), (Integer[]) null)).getList());
fArrays1(create().configuration(), new UNumberArrayRecord(create().configuration(), (Integer[]) null)).getList());
assertEquals(emptyList(),
fArrays1(create(), new UNumberArrayRecord(create())).getList());
fArrays1(create().configuration(), new UNumberArrayRecord(create().configuration())).getList());
assertEquals(asList(1),
fArrays1(create(), fArrays1(create(), new UNumberArrayRecord(create(), 1))).getList());
fArrays1(create().configuration(), fArrays1(create().configuration(), new UNumberArrayRecord(create().configuration(), 1))).getList());
assertEquals(asList(1, 2),
fArrays1(create(), fArrays1(create(), new UNumberArrayRecord(create(), 1, 2))).getList());
fArrays1(create().configuration(), fArrays1(create().configuration(), new UNumberArrayRecord(create().configuration(), 1, 2))).getList());
// Retrieving tables from functions
assertNull(fTables1(create(), null));
assertNull(fTables1(create().configuration(), null));
assertEquals(emptyList(),
fTables1(create(), new UNumberTableRecord(create(), (Integer[]) null)).getList());
fTables1(create().configuration(), new UNumberTableRecord(create().configuration(), (Integer[]) null)).getList());
assertEquals(emptyList(),
fTables1(create(), new UNumberTableRecord(create())).getList());
fTables1(create().configuration(), new UNumberTableRecord(create().configuration())).getList());
assertEquals(asList(1),
fTables1(create(), fTables1(create(), new UNumberTableRecord(create(), 1))).getList());
fTables1(create().configuration(), fTables1(create().configuration(), new UNumberTableRecord(create().configuration(), 1))).getList());
assertEquals(asList(1, 2),
fTables1(create(), fTables1(create(), new UNumberTableRecord(create(), 1, 2))).getList());
fTables1(create().configuration(), fTables1(create().configuration(), new UNumberTableRecord(create().configuration(), 1, 2))).getList());
// Retrieving arrays from procedures
assertNull(pArrays1(create(), null));
assertNull(pArrays1(create().configuration(), null));
assertEquals(emptyList(),
pArrays1(create(), new UNumberArrayRecord(create(), (Integer[]) null)).getList());
pArrays1(create().configuration(), new UNumberArrayRecord(create().configuration(), (Integer[]) null)).getList());
assertEquals(emptyList(),
pArrays1(create(), new UNumberArrayRecord(create())).getList());
pArrays1(create().configuration(), new UNumberArrayRecord(create().configuration())).getList());
assertEquals(asList(1),
pArrays1(create(), pArrays1(create(), new UNumberArrayRecord(create(), 1))).getList());
pArrays1(create().configuration(), pArrays1(create().configuration(), new UNumberArrayRecord(create().configuration(), 1))).getList());
assertEquals(asList(1, 2),
pArrays1(create(), pArrays1(create(), new UNumberArrayRecord(create(), 1, 2))).getList());
pArrays1(create().configuration(), pArrays1(create().configuration(), new UNumberArrayRecord(create().configuration(), 1, 2))).getList());
// Retrieving tables from procedures
assertNull(pTables1(create(), null));
assertNull(pTables1(create().configuration(), null));
assertEquals(emptyList(),
pTables1(create(), new UNumberTableRecord(create(), (Integer[]) null)).getList());
pTables1(create().configuration(), new UNumberTableRecord(create().configuration(), (Integer[]) null)).getList());
assertEquals(emptyList(),
pTables1(create(), new UNumberTableRecord(create())).getList());
pTables1(create().configuration(), new UNumberTableRecord(create().configuration())).getList());
assertEquals(asList(1),
pTables1(create(), pTables1(create(), new UNumberTableRecord(create(), 1))).getList());
pTables1(create().configuration(), pTables1(create().configuration(), new UNumberTableRecord(create().configuration(), 1))).getList());
assertEquals(asList(1, 2),
pTables1(create(), pTables1(create(), new UNumberTableRecord(create(), 1, 2))).getList());
pTables1(create().configuration(), pTables1(create().configuration(), new UNumberTableRecord(create().configuration(), 1, 2))).getList());
// THEN, check unnesting of VARRAY/TABLE of OBJECT
// -----------------------------------------------
@ -969,85 +969,85 @@ public class OracleTest extends jOOQAbstractTest<
// Unnesting arrays
assertEquals(emptyList(),
create().select().from(table(new UBookArrayRecord(create(), (UBookTypeRecord[]) null))).fetch(0));
create().select().from(table(new UBookArrayRecord(create().configuration(), (UBookTypeRecord[]) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(new UBookArrayRecord(create()))).fetch(0));
create().select().from(table(new UBookArrayRecord(create().configuration()))).fetch(0));
assertEquals(asList(1),
create().select().from(table(new UBookArrayRecord(create(), r1))).fetch(0));
create().select().from(table(new UBookArrayRecord(create().configuration(), r1))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 1),
create().select().from(table(new UBookArrayRecord(create(), r1))).fetch(1));
create().select().from(table(new UBookArrayRecord(create().configuration(), r1))).fetch(1));
assertEquals(asList(1, 2),
create().select().from(table(new UBookArrayRecord(create(), r1, r2))).fetch(0));
create().select().from(table(new UBookArrayRecord(create().configuration(), r1, r2))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 2),
create().select().from(table(new UBookArrayRecord(create(), r1, r2))).fetch(1));
create().select().from(table(new UBookArrayRecord(create().configuration(), r1, r2))).fetch(1));
// Unnesting tables
assertEquals(emptyList(),
create().select().from(table(new UBookTableRecord(create(), (UBookTypeRecord[]) null))).fetch(0));
create().select().from(table(new UBookTableRecord(create().configuration(), (UBookTypeRecord[]) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(new UBookTableRecord(create()))).fetch(0));
create().select().from(table(new UBookTableRecord(create().configuration()))).fetch(0));
assertEquals(asList(1),
create().select().from(table(new UBookTableRecord(create(), r1))).fetch(0));
create().select().from(table(new UBookTableRecord(create().configuration(), r1))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 1),
create().select().from(table(new UBookTableRecord(create(), r1))).fetch(1));
create().select().from(table(new UBookTableRecord(create().configuration(), r1))).fetch(1));
assertEquals(asList(1, 2),
create().select().from(table(new UBookTableRecord(create(), r1, r2))).fetch(0));
create().select().from(table(new UBookTableRecord(create().configuration(), r1, r2))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 2),
create().select().from(table(new UBookTableRecord(create(), r1, r2))).fetch(1));
create().select().from(table(new UBookTableRecord(create().configuration(), r1, r2))).fetch(1));
// Unnesting arrays from functions
assertEquals(emptyList(),
create().select().from(table(fArrays4((UBookArrayRecord) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fArrays4(new UBookArrayRecord(create(), (UBookTypeRecord[]) null)))).fetch(0));
create().select().from(table(fArrays4(new UBookArrayRecord(create().configuration(), (UBookTypeRecord[]) null)))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fArrays4(new UBookArrayRecord(create())))).fetch(0));
create().select().from(table(fArrays4(new UBookArrayRecord(create().configuration())))).fetch(0));
assertEquals(asList(1),
create().select().from(table(fArrays4(new UBookArrayRecord(create(), r1)))).fetch(0));
create().select().from(table(fArrays4(new UBookArrayRecord(create().configuration(), r1)))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 1),
create().select().from(table(fArrays4(new UBookArrayRecord(create(), r1)))).fetch(1));
create().select().from(table(fArrays4(new UBookArrayRecord(create().configuration(), r1)))).fetch(1));
assertEquals(asList(1, 2),
create().select().from(table(fArrays4(fArrays4(new UBookArrayRecord(create(), r1, r2))))).fetch(0));
create().select().from(table(fArrays4(fArrays4(new UBookArrayRecord(create().configuration(), r1, r2))))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 2),
create().select().from(table(fArrays4(fArrays4(new UBookArrayRecord(create(), r1, r2))))).fetch(1));
create().select().from(table(fArrays4(fArrays4(new UBookArrayRecord(create().configuration(), r1, r2))))).fetch(1));
// Unnesting tables from functions
assertEquals(emptyList(),
create().select().from(table(fTables4((UBookTableRecord) null))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fTables4(new UBookTableRecord(create(), (UBookTypeRecord[]) null)))).fetch(0));
create().select().from(table(fTables4(new UBookTableRecord(create().configuration(), (UBookTypeRecord[]) null)))).fetch(0));
assertEquals(emptyList(),
create().select().from(table(fTables4(new UBookTableRecord(create())))).fetch(0));
create().select().from(table(fTables4(new UBookTableRecord(create().configuration())))).fetch(0));
assertEquals(asList(1),
create().select().from(table(fTables4(new UBookTableRecord(create(), r1)))).fetch(0));
create().select().from(table(fTables4(new UBookTableRecord(create().configuration(), r1)))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 1),
create().select().from(table(fTables4(new UBookTableRecord(create(), r1)))).fetch(1));
create().select().from(table(fTables4(new UBookTableRecord(create().configuration(), r1)))).fetch(1));
assertEquals(asList(1, 2),
create().select().from(table(fTables4(fTables4(new UBookTableRecord(create(), r1, r2))))).fetch(0));
create().select().from(table(fTables4(fTables4(new UBookTableRecord(create().configuration(), r1, r2))))).fetch(0));
assertEquals(BOOK_TITLES.subList(0, 2),
create().select().from(table(fTables4(fTables4(new UBookTableRecord(create(), r1, r2))))).fetch(1));
create().select().from(table(fTables4(fTables4(new UBookTableRecord(create().configuration(), r1, r2))))).fetch(1));
// Retrieving arrays from functions
assertNull(fArrays4(create(), null));
assertNull(fArrays4(create().configuration(), null));
assertEquals(emptyList(),
fArrays4(create(), new UBookArrayRecord(create(), (UBookTypeRecord[]) null)).getList());
fArrays4(create().configuration(), new UBookArrayRecord(create().configuration(), (UBookTypeRecord[]) null)).getList());
assertEquals(emptyList(),
fArrays4(create(), new UBookArrayRecord(create())).getList());
fArrays4(create().configuration(), new UBookArrayRecord(create().configuration())).getList());
assertEquals(asList(r1),
fArrays4(create(), fArrays4(create(), new UBookArrayRecord(create(), r1))).getList());
fArrays4(create().configuration(), fArrays4(create().configuration(), new UBookArrayRecord(create().configuration(), r1))).getList());
assertEquals(asList(r1, r2),
fArrays4(create(), fArrays4(create(), new UBookArrayRecord(create(), r1, r2))).getList());
fArrays4(create().configuration(), fArrays4(create().configuration(), new UBookArrayRecord(create().configuration(), r1, r2))).getList());
// Retrieving tables from functions
assertNull(fTables4(create(), null));
assertNull(fTables4(create().configuration(), null));
assertEquals(emptyList(),
fTables4(create(), new UBookTableRecord(create(), (UBookTypeRecord[]) null)).getList());
fTables4(create().configuration(), new UBookTableRecord(create().configuration(), (UBookTypeRecord[]) null)).getList());
assertEquals(emptyList(),
fTables4(create(), new UBookTableRecord(create())).getList());
fTables4(create().configuration(), new UBookTableRecord(create().configuration())).getList());
assertEquals(asList(r1),
fTables4(create(), fTables4(create(), new UBookTableRecord(create(), r1))).getList());
fTables4(create().configuration(), fTables4(create().configuration(), new UBookTableRecord(create().configuration(), r1))).getList());
assertEquals(asList(r1, r2),
fTables4(create(), fTables4(create(), new UBookTableRecord(create(), r1, r2))).getList());
fTables4(create().configuration(), fTables4(create().configuration(), new UBookTableRecord(create().configuration(), r1, r2))).getList());
}
@ -1062,7 +1062,7 @@ public class OracleTest extends jOOQAbstractTest<
// Unattached:
author1 = new UAuthorTypeRecord();
author1.setId(1);
author2 = load(create(), author1);
author2 = load(create().configuration(), author1);
assertEquals(1, (int) author1.getId());
assertEquals(1, (int) author2.getId());
assertNull(author1.getFirstName());
@ -1113,12 +1113,12 @@ public class OracleTest extends jOOQAbstractTest<
assertEquals("Orwell", author1.getLastName());
// [#1584] Test STATIC MEMBER procedure calls
UAuthorTypeRecord author3 = UAuthorType.newAuthor(create(), 3, "first", "last");
UAuthorTypeRecord author3 = UAuthorType.newAuthor(create().configuration(), 3, "first", "last");
assertEquals(3, (int) author3.getId());
assertEquals("first", author3.getFirstName());
assertEquals("last", author3.getLastName());
UAuthorTypeRecord author4 = UAuthorType.getAuthor(create(), 3);
UAuthorTypeRecord author4 = UAuthorType.getAuthor(create().configuration(), 3);
assertEquals(author3, author4);
assertEquals(3, (int) author4.getId());
assertEquals("first", author4.getFirstName());
@ -1169,7 +1169,7 @@ public class OracleTest extends jOOQAbstractTest<
// --------------------
DateAsTimestampT_976ObjectTypeRecord o = create().newRecord(DATE_AS_TIMESTAMP_T_976_OBJECT_TYPE);
o.setD(now);
DateAsTimestampT_976VarrayTypeRecord t = new DateAsTimestampT_976VarrayTypeRecord(create());
DateAsTimestampT_976VarrayTypeRecord t = new DateAsTimestampT_976VarrayTypeRecord(create().configuration());
t.set(now, now);
record = create().newRecord(DATE_AS_TIMESTAMP_T_976);
@ -1191,12 +1191,12 @@ public class OracleTest extends jOOQAbstractTest<
// Procedures and packages
// -----------------------
assertEquals(now, org.jooq.test.oracle2.generatedclasses.Routines.p_976(create(), now));
assertEquals(now, org.jooq.test.oracle2.generatedclasses.Routines.f_976(create(), now));
assertEquals(now, org.jooq.test.oracle2.generatedclasses.Routines.p_976(create().configuration(), now));
assertEquals(now, org.jooq.test.oracle2.generatedclasses.Routines.f_976(create().configuration(), now));
assertEquals(now, create().select(org.jooq.test.oracle2.generatedclasses.Routines.f_976(now)).fetchOne(0));
assertEquals(now, org.jooq.test.oracle2.generatedclasses.packages.DateAsTimestampPkg_976.p_976(create(), now));
assertEquals(now, org.jooq.test.oracle2.generatedclasses.packages.DateAsTimestampPkg_976.f_976(create(), now));
assertEquals(now, org.jooq.test.oracle2.generatedclasses.packages.DateAsTimestampPkg_976.p_976(create().configuration(), now));
assertEquals(now, org.jooq.test.oracle2.generatedclasses.packages.DateAsTimestampPkg_976.f_976(create().configuration(), now));
assertEquals(now, create().select(org.jooq.test.oracle2.generatedclasses.packages.DateAsTimestampPkg_976.f_976(now)).fetchOne(0));
}
@ -1337,6 +1337,6 @@ public class OracleTest extends jOOQAbstractTest<
UAddressTypeRecord address = new UAddressTypeRecord();
address.setStreet(new UStreetTypeRecord());
address.getStreet().setNo("15");
assertEquals("15", Routines.pEnhanceAddress1(create, address));
assertEquals("15", Routines.pEnhanceAddress1(create.configuration(), address));
}
}

View File

@ -129,8 +129,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
Executor create = create();
create.getSettings().setExecuteLogging(false);
create.setExecuteListeners(Collections.<ExecuteListener>emptyList());
create.configuration().getSettings().setExecuteLogging(false);
create.configuration().setExecuteListeners(Collections.<ExecuteListener>emptyList());
// Dry-run to avoid side-effects
testBenchmarkFullExecution(create, 1);

View File

@ -101,7 +101,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
@Test
public void testExecuteListenerWithData() throws Exception {
Executor create = create();
create.getExecuteListeners().add(new DataListener());
create.configuration().getExecuteListeners().add(new DataListener());
create.selectOne().fetch();
}
@ -211,7 +211,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
@Test
public void testExecuteListenerCustomException() throws Exception {
Executor create = create();
create.getExecuteListeners().add(new CustomExceptionListener());
create.configuration().getExecuteListeners().add(new CustomExceptionListener());
try {
create.fetch("invalid sql");
@ -237,10 +237,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
@Test
public void testExecuteListenerOnResultQuery() throws Exception {
Executor create = create();
create.getExecuteListeners().add(new ResultQueryListener());
create.configuration().getExecuteListeners().add(new ResultQueryListener());
create.setData("Foo", "Bar");
create.setData("Bar", "Baz");
create.configuration().setData("Foo", "Bar");
create.configuration().setData("Bar", "Baz");
Result<?> result =
create.select(TBook_ID(), val("Hello"))
@ -249,7 +249,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
.fetch();
// [#1145] When inlining variables, no bind events are triggered
int plus = (SettingsTools.executePreparedStatements(create.getSettings()) ? 2 : 0);
int plus = (SettingsTools.executePreparedStatements(create.configuration().getSettings()) ? 2 : 0);
// Check correct order of listener method invocation
assertEquals(1, ResultQueryListener.start);
@ -573,7 +573,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
@Test
public void testExecuteListenerOnBatchSingle() {
if (!executePreparedStatements(create().getSettings())) {
if (!executePreparedStatements(create().configuration().getSettings())) {
log.info("SKIPPINT", "Single batch tests with statement type = STATEMENT");
return;
}
@ -581,10 +581,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
jOOQAbstractTest.reset = false;
Executor create = create();
create.getExecuteListeners().add(new BatchSingleListener());
create.configuration().getExecuteListeners().add(new BatchSingleListener());
create.setData("Foo", "Bar");
create.setData("Bar", "Baz");
create.configuration().setData("Foo", "Bar");
create.configuration().setData("Bar", "Baz");
int[] result = create.batch(create().insertInto(TAuthor())
.set(TAuthor_ID(), param("id", Integer.class))
@ -795,10 +795,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
jOOQAbstractTest.reset = false;
Executor create = create();
create.getExecuteListeners().add(new BatchMultipleListener());
create.configuration().getExecuteListeners().add(new BatchMultipleListener());
create.setData("Foo", "Bar");
create.setData("Bar", "Baz");
create.configuration().setData("Foo", "Bar");
create.configuration().setData("Bar", "Baz");
int[] result = create.batch(
create().insertInto(TAuthor())
@ -1021,7 +1021,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
@Test
public void testExecuteListenerFetchLazyTest() throws Exception {
Executor create = create();
create.getExecuteListeners().add(new FetchLazyListener());
create.configuration().getExecuteListeners().add(new FetchLazyListener());
FetchLazyListener.reset();
create.selectFrom(TAuthor()).fetch();

View File

@ -230,10 +230,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
.getValue(TAuthor_FIRST_NAME()));
// [#1191] Check execution capabilities with new features in ExecuteListener
ConnectionProviderListener.c = create().getConnectionProvider().acquire();
ConnectionProviderListener.c = create().configuration().getConnectionProvider().acquire();
try {
Executor create = create();
create.getExecuteListeners().add(new ConnectionProviderListener());
create.configuration().getExecuteListeners().add(new ConnectionProviderListener());
q = create
.selectFrom(TAuthor())
.orderBy(TAuthor_LAST_NAME());
@ -249,7 +249,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
result.get(1).store();
}
finally {
create().getConnectionProvider().release(ConnectionProviderListener.c);
create().configuration().getConnectionProvider().release(ConnectionProviderListener.c);
ConnectionProviderListener.c = null;
}
@ -308,7 +308,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
store2.attach(null);
failStoreRefreshDelete(store2);
store2.attach(create);
store2.attach(create.configuration());
store2.refresh();
assertEquals(1, store2.delete());
assertNull(create.fetchOne(TBookStore(), TBookStore_NAME().equal("Barnes and Noble")));
@ -319,7 +319,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
S store3 = create.newRecord(TBookStore());
store3.setValue(TBookStore_NAME(), "Barnes and Noble");
failStoreRefreshDelete(store3);
store3.attach(create);
store3.attach(create.configuration());
assertEquals(1, store3.store());
S store4 = create.newRecord(TBookStore());
@ -329,7 +329,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
store4.setValue(TBookStore_NAME(), "ABC");
failStoreRefreshDelete(store4);
store4 = create.fetchOne(TBookStore(), TBookStore_NAME().equal("Barnes and Noble"));
store4.attach(create);
store4.attach(create.configuration());
assertEquals(1, store4.delete());
assertNull(create.fetchOne(TBookStore(), TBookStore_NAME().equal("Barnes and Noble")));
assertNull(create.fetchOne(TBookStore(), TBookStore_NAME().equal("ABC")));

View File

@ -576,8 +576,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// [#1169] Some additional checks to see if custom data is correctly
// passed on to custom QueryParts
Executor create = create();
create.setData("Foo-Field", "Bar");
create.setData("Foo-Condition", "Bar");
create.configuration().setData("Foo-Field", "Bar");
create.configuration().setData("Foo-Condition", "Bar");
Result<Record2<Integer, Integer>> result = create
.select(TBook_ID(), IDx2)
@ -596,7 +596,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(Integer.valueOf(8), result.getValue(2, IDx2));
// [#1169] Check again
assertEquals("Baz", create.getData("Foo-Field"));
assertEquals("Baz", create.getData("Foo-Condition"));
assertEquals("Baz", create.configuration().getData("Foo-Field"));
assertEquals("Baz", create.configuration().getData("Foo-Condition"));
}
}

View File

@ -120,7 +120,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
PreparedStatement stmt = jOOQAbstractTest.connection.prepareStatement(select.getSQL());
// [#1145] Don't set bind values if not needed
if (executePreparedStatements(create().getSettings())) {
if (executePreparedStatements(create().configuration().getSettings())) {
int i = 0;
for (Object value : select.getBindValues()) {
stmt.setObject(++i, value);

View File

@ -106,10 +106,10 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
jOOQAbstractTest.reset = false;
assertEquals("1", "" + invoke(cLibrary(), "pkgPAuthorExists1", create(), "Paulo"));
assertEquals("0", "" + invoke(cLibrary(), "pkgPAuthorExists1", create(), "Shakespeare"));
assertEquals("1", "" + invoke(cLibrary(), "pkgFAuthorExists1", create(), "Paulo"));
assertEquals("0", "" + invoke(cLibrary(), "pkgFAuthorExists1", create(), "Shakespeare"));
assertEquals("1", "" + invoke(cLibrary(), "pkgPAuthorExists1", create().configuration(), "Paulo"));
assertEquals("0", "" + invoke(cLibrary(), "pkgPAuthorExists1", create().configuration(), "Shakespeare"));
assertEquals("1", "" + invoke(cLibrary(), "pkgFAuthorExists1", create().configuration(), "Paulo"));
assertEquals("0", "" + invoke(cLibrary(), "pkgFAuthorExists1", create().configuration(), "Shakespeare"));
}
@Test
@ -124,9 +124,9 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// P_AUTHOR_EXISTS
// ---------------------------------------------------------------------
if (supportsOUTParameters()) {
assertEquals("0", "" + invoke(cRoutines(), "pAuthorExists", create(), null, DUMMY_OUT_INT));
assertEquals("1", "" + invoke(cRoutines(), "pAuthorExists", create(), "Paulo", DUMMY_OUT_INT));
assertEquals("0", "" + invoke(cRoutines(), "pAuthorExists", create(), "Shakespeare", DUMMY_OUT_INT));
assertEquals("0", "" + invoke(cRoutines(), "pAuthorExists", create().configuration(), null, DUMMY_OUT_INT));
assertEquals("1", "" + invoke(cRoutines(), "pAuthorExists", create().configuration(), "Paulo", DUMMY_OUT_INT));
assertEquals("0", "" + invoke(cRoutines(), "pAuthorExists", create().configuration(), "Shakespeare", DUMMY_OUT_INT));
} else {
log.info("SKIPPING", "procedure test for OUT parameters");
}
@ -136,7 +136,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(null, create().fetchOne(
TAuthor(),
TAuthor_FIRST_NAME().equal("William")));
invoke(cRoutines(), "pCreateAuthor", create());
invoke(cRoutines(), "pCreateAuthor", create().configuration());
assertEquals("Shakespeare", create().fetchOne(
TAuthor(),
TAuthor_FIRST_NAME().equal("William")).getValue(TAuthor_LAST_NAME()));
@ -144,7 +144,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(null, create().fetchOne(
TAuthor(),
TAuthor_FIRST_NAME().equal("Hermann")));
invoke(cRoutines(), "pCreateAuthorByName", create(), "Hermann", "Hesse");
invoke(cRoutines(), "pCreateAuthorByName", create().configuration(), "Hermann", "Hesse");
assertEquals("Hesse", create().fetchOne(
TAuthor(),
TAuthor_FIRST_NAME().equal("Hermann")).getValue(TAuthor_LAST_NAME()));
@ -152,7 +152,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(null, create().fetchOne(
TAuthor(),
TAuthor_LAST_NAME().equal("Kaestner")));
invoke(cRoutines(), "pCreateAuthorByName", create(), null, "Kaestner");
invoke(cRoutines(), "pCreateAuthorByName", create().configuration(), null, "Kaestner");
assertEquals("Kaestner", create().fetchOne(
TAuthor(),
TAuthor_LAST_NAME().equal("Kaestner")).getValue(TAuthor_LAST_NAME()));
@ -165,7 +165,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// TODO: [#396] MySQL seems to have a bug when passing null to IN/OUT
// parameters. Check back on this, when this is fixed.
if (getDialect() != SQLDialect.MYSQL) {
Object p391a = invoke(cRoutines(), "p391", create(), null, null, DUMMY_OUT_INT, DUMMY_OUT_INT, null, null);
Object p391a = invoke(cRoutines(), "p391", create().configuration(), null, null, DUMMY_OUT_INT, DUMMY_OUT_INT, null, null);
assertEquals(null, invoke(p391a, "getIo1"));
assertEquals(null, invoke(p391a, "getO1"));
assertEquals(null, invoke(p391a, "getIo2"));
@ -175,13 +175,13 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// TODO: [#459] Sybase messes up IN/OUT parameter orders.
// Check back on this, when this is fixed.
if (getDialect() != SQLDialect.SYBASE) {
Object p391b = invoke(cRoutines(), "p391", create(), null, 2, DUMMY_OUT_INT, DUMMY_OUT_INT, 3, null);
Object p391b = invoke(cRoutines(), "p391", create().configuration(), null, 2, DUMMY_OUT_INT, DUMMY_OUT_INT, 3, null);
assertEquals(null, invoke(p391b, "getIo1"));
assertEquals("2", "" + invoke(p391b, "getO1"));
assertEquals(null, invoke(p391b, "getIo2"));
assertEquals("3", "" + invoke(p391b, "getO2"));
Object p391c = invoke(cRoutines(), "p391", create(), 1, 2, DUMMY_OUT_INT, DUMMY_OUT_INT, 3, 4);
Object p391c = invoke(cRoutines(), "p391", create().configuration(), 1, 2, DUMMY_OUT_INT, DUMMY_OUT_INT, 3, 4);
assertEquals("1", "" + invoke(p391c, "getIo1"));
assertEquals("2", "" + invoke(p391c, "getO1"));
assertEquals("4", "" + invoke(p391c, "getIo2"));
@ -195,32 +195,32 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// Currently, this is only supported for oracle
case ORACLE:
Object result1a = invoke(cRoutines(), "f378", create(), null, null);
Object result1a = invoke(cRoutines(), "f378", create().configuration(), null, null);
assertEquals(null, invoke(result1a, "getIo"));
assertEquals(null, invoke(result1a, "getO"));
assertEquals(null, invoke(result1a, "getReturnValue"));
Object result2a = invoke(cRoutines(), "f378", create(), null, 2);
Object result2a = invoke(cRoutines(), "f378", create().configuration(), null, 2);
assertEquals(null, invoke(result2a, "getIo"));
assertEquals("2", "" + invoke(result2a, "getO"));
assertEquals(null, invoke(result2a, "getReturnValue"));
Object result3a = invoke(cRoutines(), "f378", create(), 1, 2);
Object result3a = invoke(cRoutines(), "f378", create().configuration(), 1, 2);
assertEquals("1", "" + invoke(result3a, "getIo"));
assertEquals("2", "" + invoke(result3a, "getO"));
assertEquals("3", "" + invoke(result3a, "getReturnValue"));
Object result1b = invoke(cLibrary(), "pkgF378", create(), null, null);
Object result1b = invoke(cLibrary(), "pkgF378", create().configuration(), null, null);
assertEquals(null, invoke(result1b, "getIo"));
assertEquals(null, invoke(result1b, "getO"));
assertEquals(null, invoke(result1b, "getReturnValue"));
Object result2b = invoke(cLibrary(), "pkgF378", create(), null, 2);
Object result2b = invoke(cLibrary(), "pkgF378", create().configuration(), null, 2);
assertEquals(null, invoke(result2b, "getIo"));
assertEquals("2", "" + invoke(result2b, "getO"));
assertEquals(null, invoke(result2b, "getReturnValue"));
Object result3b = invoke(cLibrary(), "pkgF378", create(), 1, 2);
Object result3b = invoke(cLibrary(), "pkgF378", create().configuration(), 1, 2);
assertEquals("1", "" + invoke(result3b, "getIo"));
assertEquals("2", "" + invoke(result3b, "getO"));
assertEquals("3", "" + invoke(result3b, "getReturnValue"));
@ -250,7 +250,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
}
Reflect executedWithDefaults = pdefault.create();
executedWithDefaults.call("execute", create());
executedWithDefaults.call("execute", create().configuration());
assertEquals(0, executedWithDefaults.call("getPOutNumber").<Number>get().intValue());
assertEquals("0", executedWithDefaults.call("getPOutVarchar").get());
assertEquals(Date.valueOf("1981-07-10"), executedWithDefaults.call("getPOutDate").get());
@ -259,7 +259,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
executedWithoutDefault.call("setPInNumber", 123);
executedWithoutDefault.call("setPInVarchar", "abc");
executedWithoutDefault.call("setPInDate", Date.valueOf("2012-01-01"));
executedWithoutDefault.call("execute", create());
executedWithoutDefault.call("execute", create().configuration());
assertEquals(123, executedWithoutDefault.call("getPOutNumber").<Number>get().intValue());
assertEquals("abc", executedWithoutDefault.call("getPOutVarchar").get());
assertEquals(Date.valueOf("2012-01-01"), executedWithoutDefault.call("getPOutDate").get());
@ -277,18 +277,18 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// ---------------------------------------------------------------------
// Standalone calls
// ---------------------------------------------------------------------
assertEquals("0", "" + invoke(cRoutines(), "fAuthorExists", create(), null));
assertEquals("1", "" + invoke(cRoutines(), "fAuthorExists", create(), "Paulo"));
assertEquals("0", "" + invoke(cRoutines(), "fAuthorExists", create(), "Shakespeare"));
assertEquals("1", "" + invoke(cRoutines(), "fOne", create()));
assertEquals("1", "" + invoke(cRoutines(), "fNumber", create(), 1));
assertEquals(null, invoke(cRoutines(), "fNumber", create(), null));
assertEquals("1204", "" + invoke(cRoutines(), "f317", create(), 1, 2, 3, 4));
assertEquals("1204", "" + invoke(cRoutines(), "f317", create(), 1, 2, null, 4));
assertEquals("4301", "" + invoke(cRoutines(), "f317", create(), 4, 3, 2, 1));
assertEquals("4301", "" + invoke(cRoutines(), "f317", create(), 4, 3, null, 1));
assertEquals("1101", "" + invoke(cRoutines(), "f317", create(), 1, 1, 1, 1));
assertEquals("1101", "" + invoke(cRoutines(), "f317", create(), 1, 1, null, 1));
assertEquals("0", "" + invoke(cRoutines(), "fAuthorExists", create().configuration(), null));
assertEquals("1", "" + invoke(cRoutines(), "fAuthorExists", create().configuration(), "Paulo"));
assertEquals("0", "" + invoke(cRoutines(), "fAuthorExists", create().configuration(), "Shakespeare"));
assertEquals("1", "" + invoke(cRoutines(), "fOne", create().configuration()));
assertEquals("1", "" + invoke(cRoutines(), "fNumber", create().configuration(), 1));
assertEquals(null, invoke(cRoutines(), "fNumber", create().configuration(), null));
assertEquals("1204", "" + invoke(cRoutines(), "f317", create().configuration(), 1, 2, 3, 4));
assertEquals("1204", "" + invoke(cRoutines(), "f317", create().configuration(), 1, 2, null, 4));
assertEquals("4301", "" + invoke(cRoutines(), "f317", create().configuration(), 4, 3, 2, 1));
assertEquals("4301", "" + invoke(cRoutines(), "f317", create().configuration(), 4, 3, null, 1));
assertEquals("1101", "" + invoke(cRoutines(), "f317", create().configuration(), 1, 1, 1, 1));
assertEquals("1101", "" + invoke(cRoutines(), "f317", create().configuration(), 1, 1, null, 1));
// ---------------------------------------------------------------------
// Embedded calls
@ -417,11 +417,11 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
InsertQuery<?> insert = create().insertQuery(TArrays());
insert.addValue(TArrays_ID(), 5);
insert.addValue((Field) TArrays_NUMBER_R(),
on(TArrays_NUMBER_R().getType()).create(create(), new Integer[] { 1, 2, 3 }).get());
on(TArrays_NUMBER_R().getType()).create(create().configuration(), new Integer[] { 1, 2, 3 }).get());
insert.addValue((Field) TArrays_STRING_R(),
on(TArrays_STRING_R().getType()).create(create(), new String[] { "a", "b", "c", "d\"\\d" }).get());
on(TArrays_STRING_R().getType()).create(create().configuration(), new String[] { "a", "b", "c", "d\"\\d" }).get());
insert.addValue((Field) TArrays_DATE_R(),
on(TArrays_DATE_R().getType()).create(create(), new Date[] { new Date(0), new Date(84600 * 1000), new Date(84600 * 2000) }).get());
on(TArrays_DATE_R().getType()).create(create().configuration(), new Date[] { new Date(0), new Date(84600 * 1000), new Date(84600 * 2000) }).get());
insert.execute();
Record array = create().select(
@ -440,11 +440,11 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
UpdateQuery<X> update = create().updateQuery(TArrays());
update.addValue((Field) TArrays_NUMBER_R(),
on(TArrays_NUMBER_R().getType()).create(create(), new Integer[] { 3, 2, 1 }).get());
on(TArrays_NUMBER_R().getType()).create(create().configuration(), new Integer[] { 3, 2, 1 }).get());
update.addValue((Field) TArrays_STRING_R(),
on(TArrays_STRING_R().getType()).create(create(), new String[] { "d\"\\d", "c", "b", "a" }).get());
on(TArrays_STRING_R().getType()).create(create().configuration(), new String[] { "d\"\\d", "c", "b", "a" }).get());
update.addValue((Field) TArrays_DATE_R(),
on(TArrays_DATE_R().getType()).create(create(), new Date[] { new Date(84600 * 2000), new Date(84600 * 1000), new Date(0) }).get());
on(TArrays_DATE_R().getType()).create(create().configuration(), new Date[] { new Date(84600 * 2000), new Date(84600 * 1000), new Date(0) }).get());
update.addConditions(TArrays_ID().equal(5));
update.execute();
@ -660,12 +660,12 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
ArrayRecord<Long> l;
ArrayRecord<String> s;
assertEquals(null, invoke(cRoutines(), "pArrays1", create(), null));
assertEquals(null, invoke(cRoutines(), "pArrays2", create(), null));
assertEquals(null, invoke(cRoutines(), "pArrays3", create(), null));
assertEquals(null, invoke(cRoutines(), "fArrays1", create(), null));
assertEquals(null, invoke(cRoutines(), "fArrays2", create(), null));
assertEquals(null, invoke(cRoutines(), "fArrays3", create(), null));
assertEquals(null, invoke(cRoutines(), "pArrays1", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "pArrays2", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "pArrays3", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "fArrays1", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "fArrays2", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "fArrays3", create().configuration(), null));
i = newNUMBER_R();
l = newNUMBER_LONG_R();
@ -673,22 +673,22 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(
Arrays.asList(new Integer[0]),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays1", create(), i)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays1", create().configuration(), i)).get()));
assertEquals(
Arrays.asList(new Long[0]),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays2", create(), l)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays2", create().configuration(), l)).get()));
assertEquals(
Arrays.asList(new String[0]),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays3", create(), s)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays3", create().configuration(), s)).get()));
assertEquals(
Arrays.asList(new Integer[0]),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays1", create(), i)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays1", create().configuration(), i)).get()));
assertEquals(
Arrays.asList(new Long[0]),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays2", create(), l)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays2", create().configuration(), l)).get()));
assertEquals(
Arrays.asList(new String[0]),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays3", create(), s)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays3", create().configuration(), s)).get()));
i = newNUMBER_R();
l = newNUMBER_LONG_R();
@ -700,22 +700,22 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(
Arrays.asList((Integer) null),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays1", create(), i)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays1", create().configuration(), i)).get()));
assertEquals(
Arrays.asList((Long) null),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays2", create(), l)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays2", create().configuration(), l)).get()));
assertEquals(
Arrays.asList((String) null),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays3", create(), s)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays3", create().configuration(), s)).get()));
assertEquals(
Arrays.asList((Integer) null),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays1", create(), i)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays1", create().configuration(), i)).get()));
assertEquals(
Arrays.asList((Long) null),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays2", create(), l)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays2", create().configuration(), l)).get()));
assertEquals(
Arrays.asList((String) null),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays3", create(), s)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays3", create().configuration(), s)).get()));
i = newNUMBER_R();
l = newNUMBER_LONG_R();
@ -727,115 +727,115 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(
Arrays.asList(1, 2),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays1", create(), i)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays1", create().configuration(), i)).get()));
assertEquals(
Arrays.asList(1L, 2L),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays2", create(), l)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays2", create().configuration(), l)).get()));
assertEquals(
Arrays.asList("1", "2"),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays3", create(), s)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "pArrays3", create().configuration(), s)).get()));
assertEquals(
Arrays.asList(1, 2),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays1", create(), i)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays1", create().configuration(), i)).get()));
assertEquals(
Arrays.asList(1L, 2L),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays2", create(), l)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays2", create().configuration(), l)).get()));
assertEquals(
Arrays.asList("1", "2"),
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays3", create(), s)).get()));
Arrays.asList(((ArrayRecord<?>) invoke(cRoutines(), "fArrays3", create().configuration(), s)).get()));
}
if (TArrays_STRING() != null) {
if (supportsOUTParameters()) {
assertEquals(null, invoke(cRoutines(), "pArrays1", create(), null));
assertEquals(null, invoke(cRoutines(), "pArrays2", create(), null));
assertEquals(null, invoke(cRoutines(), "pArrays3", create(), null));
assertEquals(null, invoke(cRoutines(), "pArrays1", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "pArrays2", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "pArrays3", create().configuration(), null));
}
assertEquals(null, invoke(cRoutines(), "fArrays1", create(), null));
assertEquals(null, invoke(cRoutines(), "fArrays2", create(), null));
assertEquals(null, invoke(cRoutines(), "fArrays3", create(), null));
assertEquals(null, invoke(cRoutines(), "fArrays1", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "fArrays2", create().configuration(), null));
assertEquals(null, invoke(cRoutines(), "fArrays3", create().configuration(), null));
if (supportsOUTParameters()) {
assertEquals(
Arrays.asList(new Integer[0]),
Arrays.asList((Integer[]) invoke(cRoutines(), "pArrays1", create(), new Integer[0])));
Arrays.asList((Integer[]) invoke(cRoutines(), "pArrays1", create().configuration(), new Integer[0])));
assertEquals(
Arrays.asList(new Long[0]),
Arrays.asList((Long[]) invoke(cRoutines(), "pArrays2", create(), new Long[0])));
Arrays.asList((Long[]) invoke(cRoutines(), "pArrays2", create().configuration(), new Long[0])));
assertEquals(
Arrays.asList(new String[0]),
Arrays.asList((String[]) invoke(cRoutines(), "pArrays3", create(), new String[0])));
Arrays.asList((String[]) invoke(cRoutines(), "pArrays3", create().configuration(), new String[0])));
}
assertEquals(
Arrays.asList(new Integer[0]),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays1", create(), new Integer[0])));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays1", create().configuration(), new Integer[0])));
assertEquals(
Arrays.asList(new Long[0]),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays2", create(), new Long[0])));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays2", create().configuration(), new Long[0])));
assertEquals(
Arrays.asList(new String[0]),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays3", create(), new String[0])));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays3", create().configuration(), new String[0])));
if (supportsOUTParameters()) {
assertEquals(
Arrays.asList((Integer) null),
Arrays.asList((Integer[]) invoke(cRoutines(), "pArrays1", create(), new Integer[] { null })));
Arrays.asList((Integer[]) invoke(cRoutines(), "pArrays1", create().configuration(), new Integer[] { null })));
assertEquals(
Arrays.asList((Long) null),
Arrays.asList((Long[]) invoke(cRoutines(), "pArrays2", create(), new Long[] { null })));
Arrays.asList((Long[]) invoke(cRoutines(), "pArrays2", create().configuration(), new Long[] { null })));
assertEquals(
Arrays.asList((String) null),
Arrays.asList((String[]) invoke(cRoutines(), "pArrays3", create(), new String[] { null })));
Arrays.asList((String[]) invoke(cRoutines(), "pArrays3", create().configuration(), new String[] { null })));
}
assertEquals(
Arrays.asList((Integer) null),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays1", create(), new Integer[] { null })));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays1", create().configuration(), new Integer[] { null })));
assertEquals(
Arrays.asList((Long) null),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays2", create(), new Long[] { null })));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays2", create().configuration(), new Long[] { null })));
assertEquals(
Arrays.asList((String) null),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays3", create(), new String[] { null })));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays3", create().configuration(), new String[] { null })));
if (supportsOUTParameters()) {
assertEquals(
Arrays.asList(1, 2),
Arrays.asList((Integer[]) invoke(cRoutines(), "pArrays1", create(), new Integer[] {1, 2})));
Arrays.asList((Integer[]) invoke(cRoutines(), "pArrays1", create().configuration(), new Integer[] {1, 2})));
assertEquals(
Arrays.asList(1L, 2L),
Arrays.asList((Long[]) invoke(cRoutines(), "pArrays2", create(), new Long[] {1L, 2L})));
Arrays.asList((Long[]) invoke(cRoutines(), "pArrays2", create().configuration(), new Long[] {1L, 2L})));
assertEquals(
Arrays.asList("1", "2"),
Arrays.asList((String[]) invoke(cRoutines(), "pArrays3", create(), new String[] {"1", "2"})));
Arrays.asList((String[]) invoke(cRoutines(), "pArrays3", create().configuration(), new String[] {"1", "2"})));
}
assertEquals(
Arrays.asList(1, 2),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays1", create(), new Integer[] {1, 2})));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays1", create().configuration(), new Integer[] {1, 2})));
assertEquals(
Arrays.asList(1L, 2L),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays2", create(), new Long[] {1L, 2L})));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays2", create().configuration(), new Long[] {1L, 2L})));
assertEquals(
Arrays.asList("1", "2"),
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays3", create(), new String[] {"1", "2"})));
Arrays.asList((Object[]) invoke(cRoutines(), "fArrays3", create().configuration(), new String[] {"1", "2"})));
}
}
private ArrayRecord<Integer> newNUMBER_R() throws Exception {
ArrayRecord<Integer> result = TArrays_NUMBER_R().getType().getConstructor(Configuration.class).newInstance(create());
ArrayRecord<Integer> result = TArrays_NUMBER_R().getType().getConstructor(Configuration.class).newInstance(create().configuration());
return result;
}
private ArrayRecord<Long> newNUMBER_LONG_R() throws Exception {
ArrayRecord<Long> result = TArrays_NUMBER_LONG_R().getType().getConstructor(Configuration.class).newInstance(create());
ArrayRecord<Long> result = TArrays_NUMBER_LONG_R().getType().getConstructor(Configuration.class).newInstance(create().configuration());
return result;
}
private ArrayRecord<String> newSTRING_R() throws Exception {
ArrayRecord<String> result = TArrays_STRING_R().getType().getConstructor(Configuration.class).newInstance(create());
ArrayRecord<String> result = TArrays_STRING_R().getType().getConstructor(Configuration.class).newInstance(create().configuration());
return result;
}
@ -912,11 +912,11 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
invoke(address, "setStreet", street);
// First procedure
Object result = invoke(cRoutines(), "pEnhanceAddress1", create(), address);
Object result = invoke(cRoutines(), "pEnhanceAddress1", create().configuration(), address);
assertEquals("35", result);
// Second procedure
address = invoke(cRoutines(), "pEnhanceAddress2", create());
address = invoke(cRoutines(), "pEnhanceAddress2", create().configuration());
street = invoke(address, "getStreet");
assertEquals("Parliament Hill", invoke(street, "getStreet"));
assertEquals("77", invoke(street, "getNo"));
@ -929,7 +929,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
}
// Third procedure
address = (UDTRecord<?>) invoke(cRoutines(), "pEnhanceAddress3", create(), address);
address = (UDTRecord<?>) invoke(cRoutines(), "pEnhanceAddress3", create().configuration(), address);
street = (UDTRecord<?>) invoke(address, "getStreet");
assertEquals("Zwinglistrasse", invoke(street, "getStreet"));
assertEquals("17", invoke(street, "getNo"));
@ -1215,7 +1215,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// Get an empty cursor
// -------------------
Result<Record> bFromCursor = invoke(cRoutines(), "fGetOneCursor", create(), integerArray);
Result<Record> bFromCursor = invoke(cRoutines(), "fGetOneCursor", create().configuration(), integerArray);
assertNotNull(bFromCursor);
assertTrue(bFromCursor.isEmpty());
@ -1232,7 +1232,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
integerArray = new Integer[] { 1, 2, 4, 6 };
}
bFromCursor = invoke(cRoutines(), "fGetOneCursor", create(), integerArray);
bFromCursor = invoke(cRoutines(), "fGetOneCursor", create().configuration(), integerArray);
Result<B> bFromTable = create()
.selectFrom(TBook())
@ -1309,7 +1309,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
// Get an empty cursor
// -------------------
Object result = invoke(cRoutines(), "pGetOneCursor", create(), integerArray);
Object result = invoke(cRoutines(), "pGetOneCursor", create().configuration(), integerArray);
assertNotNull(result);
assertEquals("0", "" + invoke(result, "getTotal"));
@ -1329,7 +1329,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
integerArray = new Integer[] { 1, 2, 4, 6 };
}
result = invoke(cRoutines(), "pGetOneCursor", create(), integerArray);
result = invoke(cRoutines(), "pGetOneCursor", create().configuration(), integerArray);
assertEquals("3", "" + invoke(result, "getTotal"));
bFromCursor = invoke(result, "getBooks");

View File

@ -374,8 +374,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
final Executor create1 = create();
final Executor create2 = create();
((DefaultConnectionProvider) create2.getConnectionProvider()).setConnection(getNewConnection());
create2.getConnectionProvider().acquire().setAutoCommit(false);
((DefaultConnectionProvider) create2.configuration().getConnectionProvider()).setConnection(getNewConnection());
create2.configuration().getConnectionProvider().acquire().setAutoCommit(false);
final Vector<String> execOrder = new Vector<String>();
@ -417,8 +417,8 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
execOrder.add("t1-fail-or-t2-commit");
try {
create2.getConnectionProvider().acquire().commit();
create2.getConnectionProvider().acquire().close();
create2.configuration().getConnectionProvider().acquire().commit();
create2.configuration().getConnectionProvider().acquire().close();
}
catch (Exception e) {}
}
@ -442,7 +442,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
}
finally {
try {
create2.getConnectionProvider().acquire().close();
create2.configuration().getConnectionProvider().acquire().close();
}
catch (Exception e) {}
}

View File

@ -100,7 +100,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
@Test
public void testKeepStatement() throws Exception {
Executor create = create();
create.getExecuteListeners().add(new KeepStatementListener());
create.configuration().getExecuteListeners().add(new KeepStatementListener());
// [#385] By default, new statements are created for every execution
KeepStatementListener.reset();
@ -129,7 +129,7 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
assertEquals(4, KeepStatementListener.statements.size());
assertEquals(0, KeepStatementListener.closed);
assertEquals(
create().getSettings().getStatementType() == StatementType.PREPARED_STATEMENT,
create().configuration().getSettings().getStatementType() == StatementType.PREPARED_STATEMENT,
KeepStatementListener.statements.get(0) ==
KeepStatementListener.statements.get(1));

View File

@ -61,7 +61,7 @@ import org.jooq.test.h2.generatedclasses.tables.TBook;
public class F {
public static void pCreateAuthor(Connection connection) {
Routines.pCreateAuthorByName(create(connection), "William", "Shakespeare");
Routines.pCreateAuthorByName(create(connection).configuration(), "William", "Shakespeare");
}
public static void pCreateAuthorByName(Connection connection, String firstName, String lastName) {

View File

@ -849,13 +849,13 @@ public abstract class jOOQAbstractTest<
.withDefaultSchema(defaultSchema));
Executor create = create(settings);
create.getExecuteListeners().add(new TestStatisticsListener());
create.getExecuteListeners().add(new PrettyPrinter());
create.configuration().getExecuteListeners().add(new TestStatisticsListener());
create.configuration().getExecuteListeners().add(new PrettyPrinter());
return create;
}
protected final SQLDialect getDialect() {
return create().getDialect();
return create().configuration().getDialect();
}
protected String getSchemaSuffix() {

View File

@ -10239,6 +10239,20 @@ Condition condition1 = BOOK.TITLE.equal(possiblyNull);
Condition condition2 = BOOK.TITLE.equal(possiblyNull).or(BOOK.TITLE.isNull().and(val(possiblyNull).isNull()));
Condition condition3 = BOOK.TITLE.isNotDistinctFrom(possiblyNull);]]></java>
<h3>Configuration</h3>
<p>
<code>Executor</code>, <code>ExecuteContext</code>, <code>RenderContext</code>, <code>BindContext</code> no longer extend <code>Configuration</code> for "convenience". From jOOQ 3.0 onwards, composition is chosen over inheritance as these objects are not really configurations. Most importantly
</p>
<ul>
<li><code>Executor</code> is only a DSL entry point for constructing "attached" QueryParts</li>
<li><code>ExecuteContext</code> has a well-defined lifecycle, tied to that of a single query execution</li>
<li><code>RenderContext</code> has a well-defined lifecycle, tied to that of a single rendering operation</li>
<li><code>BindContext</code> has a well-defined lifecycle, tied to that of a single variable binding operation</li>
</ul>
<p>
In order to resolve confusion that used to arise because of different lifecycle durations, these types are now no longer formally connected through inheritance.
</p>
<h3>ConnectionProvider</h3>
<p>
In order to allow for simpler connection / data source management, jOOQ externalised connection handling in a new ConnectionProvider type. The previous two connection modes are maintained backwards-compatibly (JDBC standalone connection mode, pooled DataSource mode). Other connection modes can be injected using:

View File

@ -63,11 +63,13 @@ class BatchCRUD implements Batch {
private static final long serialVersionUID = -2935544935267715011L;
private final Executor create;
private final Configuration configuration;
private final UpdatableRecord<?>[] records;
private final Action action;
BatchCRUD(Executor create, Action action, UpdatableRecord<?>[] records) {
this.create = create;
BatchCRUD(Configuration configuration, Action action, UpdatableRecord<?>[] records) {
this.create = new Executor(configuration);
this.configuration = configuration;
this.action = action;
this.records = records;
}
@ -82,7 +84,7 @@ class BatchCRUD implements Batch {
// [#1180] Run batch queries with BatchMultiple, if no bind variables
// should be used...
if (executeStaticStatements(create.getSettings())) {
if (executeStaticStatements(configuration.getSettings())) {
return executeStatic();
}
else {
@ -93,24 +95,24 @@ class BatchCRUD implements Batch {
private final int[] executePrepared() {
Map<String, List<Query>> queries = new LinkedHashMap<String, List<Query>>();
Boolean executeLogging = create.getSettings().isExecuteLogging();
Boolean executeLogging = configuration.getSettings().isExecuteLogging();
QueryCollector collector = new QueryCollector();
try {
// [#1537] Communicate with UpdatableRecordImpl
create.setData(Utils.DATA_OMIT_RETURNING_CLAUSE, true);
configuration.setData(Utils.DATA_OMIT_RETURNING_CLAUSE, true);
// Add the QueryCollector to intercept query execution after rendering
create.getExecuteListeners().add(collector);
configuration.getExecuteListeners().add(collector);
// [#1529] Avoid DEBUG logging of single INSERT / UPDATE statements
create.getSettings().setExecuteLogging(false);
configuration.getSettings().setExecuteLogging(false);
for (int i = 0; i < records.length; i++) {
Configuration previous = ((AttachableInternal) records[i]).getConfiguration();
try {
records[i].attach(create);
records[i].attach(configuration);
executeAction(i);
}
catch (QueryCollectorException e) {
@ -137,10 +139,10 @@ class BatchCRUD implements Batch {
// Restore the original factory
finally {
create.getData().remove(Utils.DATA_OMIT_RETURNING_CLAUSE);
configuration.getData().remove(Utils.DATA_OMIT_RETURNING_CLAUSE);
create.getExecuteListeners().remove(collector);
create.getSettings().setExecuteLogging(executeLogging);
configuration.getExecuteListeners().remove(collector);
configuration.getSettings().setExecuteLogging(executeLogging);
}
// Execute one batch statement for each identical SQL statement. Every
@ -174,13 +176,13 @@ class BatchCRUD implements Batch {
QueryCollector collector = new QueryCollector();
try {
create.getExecuteListeners().add(collector);
configuration.getExecuteListeners().add(collector);
for (int i = 0; i < records.length; i++) {
Configuration previous = ((AttachableInternal) records[i]).getConfiguration();
try {
records[i].attach(create);
records[i].attach(configuration);
executeAction(i);
}
catch (QueryCollectorException e) {
@ -198,7 +200,7 @@ class BatchCRUD implements Batch {
// Restore the original factory
finally {
create.getExecuteListeners().remove(collector);
configuration.getExecuteListeners().remove(collector);
}
// Resulting statements can be batch executed in their requested order

View File

@ -39,6 +39,7 @@ import java.sql.Connection;
import java.sql.SQLException;
import org.jooq.Batch;
import org.jooq.Configuration;
import org.jooq.ExecuteContext;
import org.jooq.ExecuteListener;
import org.jooq.Query;
@ -51,13 +52,13 @@ class BatchMultiple implements Batch {
/**
* Generated UID
*/
private static final long serialVersionUID = -7337667281292354043L;
private static final long serialVersionUID = -7337667281292354043L;
private final Executor create;
private final Query[] queries;
private final Configuration configuration;
private final Query[] queries;
public BatchMultiple(Executor create, Query... queries) {
this.create = create;
public BatchMultiple(Configuration configuration, Query... queries) {
this.configuration = configuration;
this.queries = queries;
}
@ -68,7 +69,7 @@ class BatchMultiple implements Batch {
@Override
public final int[] execute() {
ExecuteContext ctx = new DefaultExecuteContext(create, queries);
ExecuteContext ctx = new DefaultExecuteContext(configuration, queries);
ExecuteListener listener = new ExecuteListeners(ctx);
Connection connection = ctx.connection();
@ -78,7 +79,7 @@ class BatchMultiple implements Batch {
String[] batchSQL = ctx.batchSQL();
for (int i = 0; i < queries.length; i++) {
listener.renderStart(ctx);
batchSQL[i] = create.renderInlined(queries[i]);
batchSQL[i] = new Executor(configuration).renderInlined(queries[i]);
listener.renderEnd(ctx);
}

View File

@ -43,6 +43,7 @@ import java.util.ArrayList;
import java.util.List;
import org.jooq.BatchBindStep;
import org.jooq.Configuration;
import org.jooq.ExecuteContext;
import org.jooq.ExecuteListener;
import org.jooq.Param;
@ -59,11 +60,13 @@ class BatchSingle implements BatchBindStep {
private static final long serialVersionUID = 3793967258181493207L;
private final Executor create;
private final Configuration configuration;
private final Query query;
private final List<Object[]> allBindValues;
public BatchSingle(Executor create, Query query) {
this.create = create;
public BatchSingle(Configuration configuration, Query query) {
this.create = new Executor(configuration);
this.configuration = configuration;
this.query = query;
this.allBindValues = new ArrayList<Object[]>();
}
@ -102,7 +105,7 @@ class BatchSingle implements BatchBindStep {
}
private final int[] executePrepared() {
ExecuteContext ctx = new DefaultExecuteContext(create, new Query[] { query });
ExecuteContext ctx = new DefaultExecuteContext(configuration, new Query[] { query });
ExecuteListener listener = new ExecuteListeners(ctx);
Connection connection = ctx.connection();
@ -132,7 +135,7 @@ class BatchSingle implements BatchBindStep {
for (int i = 0; i < params.size(); i++) {
params.get(i).setConverted(bindValues[i]);
}
new DefaultBindContext(create, ctx.statement()).bind(params);
new DefaultBindContext(configuration, ctx.statement()).bind(params);
listener.bindEnd(ctx);
ctx.statement().addBatch();

View File

@ -57,6 +57,7 @@ import static org.jooq.impl.Factory.trueCondition;
import static org.jooq.impl.Utils.list;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader;
import java.math.BigInteger;
import java.sql.Connection;
@ -228,7 +229,7 @@ import org.jooq.tools.csv.CSVReader;
* @author Lukas Eder
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class Executor implements Configuration {
public class Executor implements Serializable {
/**
* Generated UID
@ -392,50 +393,8 @@ public class Executor implements Configuration {
// XXX Configuration API
// -------------------------------------------------------------------------
@Override
public final SQLDialect getDialect() {
return configuration.getDialect();
}
@Override
@Deprecated
public final org.jooq.SchemaMapping getSchemaMapping() {
return configuration.getSchemaMapping();
}
@Override
public final Settings getSettings() {
return configuration.getSettings();
}
@Override
public final Map<Object, Object> getData() {
return configuration.getData();
}
@Override
public final Object getData(Object key) {
return configuration.getData(key);
}
@Override
public final Object setData(Object key, Object value) {
return configuration.setData(key, value);
}
@Override
public final ConnectionProvider getConnectionProvider() {
return configuration.getConnectionProvider();
}
@Override
public final List<ExecuteListener> getExecuteListeners() {
return configuration.getExecuteListeners();
}
@Override
public final void setExecuteListeners(List<ExecuteListener> listeners) {
configuration.setExecuteListeners(listeners);
public final Configuration configuration() {
return configuration;
}
/**
@ -449,7 +408,7 @@ public class Executor implements Configuration {
* @return The mapped schema
*/
public final Schema map(Schema schema) {
return Utils.getMappedSchema(this, schema);
return Utils.getMappedSchema(configuration, schema);
}
/**
@ -463,7 +422,7 @@ public class Executor implements Configuration {
* @return The mapped table
*/
public final <R extends Record> Table<R> map(Table<R> table) {
return Utils.getMappedTable(this, table);
return Utils.getMappedTable(configuration, table);
}
// -------------------------------------------------------------------------
@ -477,7 +436,7 @@ public class Executor implements Configuration {
* connection's database meta data.
*/
public final Meta meta() {
return new MetaImpl(this);
return new MetaImpl(configuration);
}
// -------------------------------------------------------------------------
@ -502,7 +461,7 @@ public class Executor implements Configuration {
* </ul>
*/
public final RenderContext renderContext() {
return new DefaultRenderContext(this);
return new DefaultRenderContext(configuration);
}
/**
@ -576,7 +535,7 @@ public class Executor implements Configuration {
* @see Factory#param(String, Object)
*/
public final Map<String, Param<?>> extractParams(QueryPart part) {
ParamCollector collector = new ParamCollector(this);
ParamCollector collector = new ParamCollector(configuration);
collector.bind(part);
return Collections.unmodifiableMap(collector.result);
}
@ -606,7 +565,7 @@ public class Executor implements Configuration {
* RenderContext for JOOQ INTERNAL USE only. Avoid referencing it directly
*/
public final BindContext bindContext(PreparedStatement stmt) {
return new DefaultBindContext(this, stmt);
return new DefaultBindContext(configuration, stmt);
}
/**
@ -640,7 +599,7 @@ public class Executor implements Configuration {
*/
public final void attach(Collection<? extends Attachable> attachables) {
for (Attachable attachable : attachables) {
attachable.attach(this);
attachable.attach(configuration);
}
}
@ -654,7 +613,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends TableRecord<R>> LoaderOptionsStep<R> loadInto(Table<R> table) {
return new LoaderImpl<R>(this, table);
return new LoaderImpl<R>(configuration, table);
}
/**
@ -699,7 +658,7 @@ public class Executor implements Configuration {
*/
@Support
public final Query query(String sql, Object... bindings) {
return new SQLQuery(this, sql, bindings);
return new SQLQuery(configuration, sql, bindings);
}
/**
@ -730,7 +689,7 @@ public class Executor implements Configuration {
*/
@Support
public final Query query(String sql, QueryPart... parts) {
return new SQLQuery(this, sql, parts);
return new SQLQuery(configuration, sql, parts);
}
/**
@ -1287,7 +1246,7 @@ public class Executor implements Configuration {
*/
@Support
public final ResultQuery<Record> resultQuery(String sql, Object... bindings) {
return new SQLResultQuery(this, sql, bindings);
return new SQLResultQuery(configuration, sql, bindings);
}
/**
@ -1318,7 +1277,7 @@ public class Executor implements Configuration {
*/
@Support
public final ResultQuery<Record> resultQuery(String sql, QueryPart... parts) {
return new SQLResultQuery(this, sql, parts);
return new SQLResultQuery(configuration, sql, parts);
}
// -------------------------------------------------------------------------
@ -1509,7 +1468,7 @@ public class Executor implements Configuration {
@Support
public final Cursor<Record> fetchLazy(ResultSet rs) throws DataAccessException {
try {
return fetchLazy(rs, new MetaDataFieldProvider(this, rs.getMetaData()).getFields());
return fetchLazy(rs, new MetaDataFieldProvider(configuration, rs.getMetaData()).getFields());
}
catch (SQLException e) {
throw new DataAccessException("Error while accessing ResultSet meta data", e);
@ -1532,7 +1491,7 @@ public class Executor implements Configuration {
*/
@Support
public final Cursor<Record> fetchLazy(ResultSet rs, Field<?>... fields) throws DataAccessException {
ExecuteContext ctx = new DefaultExecuteContext(this);
ExecuteContext ctx = new DefaultExecuteContext(configuration);
ExecuteListener listener = new ExecuteListeners(ctx);
ctx.resultSet(rs);
@ -1784,7 +1743,7 @@ public class Executor implements Configuration {
*/
public final Result<Record> fetchFromStringData(List<String[]> data) {
if (data.size() == 0) {
return new ResultImpl<Record>(this);
return new ResultImpl<Record>(configuration);
}
else {
List<Field<?>> fields = new ArrayList<Field<?>>();
@ -1793,7 +1752,7 @@ public class Executor implements Configuration {
fields.add(fieldByName(String.class, name));
}
Result<Record> result = new ResultImpl<Record>(this, fields);
Result<Record> result = new ResultImpl<Record>(configuration, fields);
if (data.size() > 1) {
for (String[] values : data.subList(1, data.size())) {
@ -1825,7 +1784,7 @@ public class Executor implements Configuration {
@Support
public final <R extends Record> SelectWhereStep<R> selectFrom(Table<R> table) {
SelectWhereStep<R> result = Factory.selectFrom(table);
result.attach(this);
result.attach(configuration);
return result;
}
@ -1853,7 +1812,7 @@ public class Executor implements Configuration {
@Support
public final SelectSelectStep<Record> select(Collection<? extends Field<?>> fields) {
SelectSelectStep<Record> result = Factory.select(fields);
result.attach(this);
result.attach(configuration);
return result;
}
@ -1882,7 +1841,7 @@ public class Executor implements Configuration {
@Support
public final SelectSelectStep<Record> select(Field<?>... fields) {
SelectSelectStep<Record> result = Factory.select(fields);
result.attach(this);
result.attach(configuration);
return result;
}
@ -2640,7 +2599,7 @@ public class Executor implements Configuration {
@Support
public final SelectSelectStep<Record> selectDistinct(Collection<? extends Field<?>> fields) {
SelectSelectStep<Record> result = Factory.selectDistinct(fields);
result.attach(this);
result.attach(configuration);
return result;
}
@ -2668,7 +2627,7 @@ public class Executor implements Configuration {
@Support
public final SelectSelectStep<Record> selectDistinct(Field<?>... fields) {
SelectSelectStep<Record> result = Factory.selectDistinct(fields);
result.attach(this);
result.attach(configuration);
return result;
}
@ -3427,7 +3386,7 @@ public class Executor implements Configuration {
@Support
public final SelectSelectStep<Record1<Integer>> selectZero() {
SelectSelectStep<Record1<Integer>> result = Factory.selectZero();
result.attach(this);
result.attach(configuration);
return result;
}
@ -3456,7 +3415,7 @@ public class Executor implements Configuration {
@Support
public final SelectSelectStep<Record1<Integer>> selectOne() {
SelectSelectStep<Record1<Integer>> result = Factory.selectOne();
result.attach(this);
result.attach(configuration);
return result;
}
@ -3484,7 +3443,7 @@ public class Executor implements Configuration {
@Support
public final SelectSelectStep<Record1<Integer>> selectCount() {
SelectSelectStep<Record1<Integer>> result = Factory.selectCount();
result.attach(this);
result.attach(configuration);
return result;
}
@ -3493,7 +3452,7 @@ public class Executor implements Configuration {
*/
@Support
public final SelectQuery<Record> selectQuery() {
return new SelectQueryImpl(this);
return new SelectQueryImpl(configuration);
}
/**
@ -3504,7 +3463,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> SelectQuery<R> selectQuery(TableLike<R> table) {
return new SelectQueryImpl<R>(this, table);
return new SelectQueryImpl<R>(configuration, table);
}
/**
@ -3515,7 +3474,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> InsertQuery<R> insertQuery(Table<R> into) {
return new InsertQueryImpl<R>(this, into);
return new InsertQueryImpl<R>(configuration, into);
}
/**
@ -3540,7 +3499,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> InsertSetStep<R> insertInto(Table<R> into) {
return new InsertImpl(this, into, Collections.<Field<?>>emptyList());
return new InsertImpl(configuration, into, Collections.<Field<?>>emptyList());
}
// [jooq-tools] START [insert]
@ -3563,7 +3522,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1> InsertValuesStep1<R, T1> insertInto(Table<R> into, Field<T1> field1) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1 }));
}
/**
@ -3584,7 +3543,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2> InsertValuesStep2<R, T1, T2> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2 }));
}
/**
@ -3605,7 +3564,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3> InsertValuesStep3<R, T1, T2, T3> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3 }));
}
/**
@ -3626,7 +3585,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4> InsertValuesStep4<R, T1, T2, T3, T4> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4 }));
}
/**
@ -3647,7 +3606,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5> InsertValuesStep5<R, T1, T2, T3, T4, T5> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5 }));
}
/**
@ -3668,7 +3627,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6> InsertValuesStep6<R, T1, T2, T3, T4, T5, T6> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6 }));
}
/**
@ -3689,7 +3648,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7> InsertValuesStep7<R, T1, T2, T3, T4, T5, T6, T7> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7 }));
}
/**
@ -3710,7 +3669,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8> InsertValuesStep8<R, T1, T2, T3, T4, T5, T6, T7, T8> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8 }));
}
/**
@ -3731,7 +3690,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9> InsertValuesStep9<R, T1, T2, T3, T4, T5, T6, T7, T8, T9> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 }));
}
/**
@ -3752,7 +3711,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> InsertValuesStep10<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10 }));
}
/**
@ -3773,7 +3732,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> InsertValuesStep11<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11 }));
}
/**
@ -3794,7 +3753,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> InsertValuesStep12<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12 }));
}
/**
@ -3815,7 +3774,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> InsertValuesStep13<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13 }));
}
/**
@ -3836,7 +3795,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> InsertValuesStep14<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14 }));
}
/**
@ -3857,7 +3816,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> InsertValuesStep15<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15 }));
}
/**
@ -3878,7 +3837,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> InsertValuesStep16<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16 }));
}
/**
@ -3899,7 +3858,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> InsertValuesStep17<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17 }));
}
/**
@ -3920,7 +3879,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> InsertValuesStep18<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18 }));
}
/**
@ -3941,7 +3900,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> InsertValuesStep19<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19 }));
}
/**
@ -3962,7 +3921,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> InsertValuesStep20<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20 }));
}
/**
@ -3983,7 +3942,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> InsertValuesStep21<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21 }));
}
/**
@ -4004,7 +3963,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> InsertValuesStep22<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> insertInto(Table<R> into, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21, Field<T22> field22) {
return new InsertImpl(this, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22 }));
return new InsertImpl(configuration, into, Arrays.asList(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22 }));
}
// [jooq-tools] END [insert]
@ -4026,7 +3985,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> InsertValuesStepN<R> insertInto(Table<R> into, Field<?>... fields) {
return new InsertImpl(this, into, Arrays.asList(fields));
return new InsertImpl(configuration, into, Arrays.asList(fields));
}
/**
@ -4046,7 +4005,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> InsertValuesStepN<R> insertInto(Table<R> into, Collection<? extends Field<?>> fields) {
return new InsertImpl(this, into, fields);
return new InsertImpl(configuration, into, fields);
}
/**
@ -4057,7 +4016,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> UpdateQuery<R> updateQuery(Table<R> table) {
return new UpdateQueryImpl<R>(this, table);
return new UpdateQueryImpl<R>(configuration, table);
}
/**
@ -4085,7 +4044,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> UpdateSetFirstStep<R> update(Table<R> table) {
return new UpdateImpl<R>(this, table);
return new UpdateImpl<R>(configuration, table);
}
/**
@ -4164,7 +4123,7 @@ public class Executor implements Configuration {
*/
@Support({ CUBRID, DB2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record> MergeUsingStep<R> mergeInto(Table<R> table) {
return new MergeImpl(this, table);
return new MergeImpl(configuration, table);
}
// [jooq-tools] START [merge]
@ -4192,7 +4151,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1> MergeKeyStep1<R, T1> mergeInto(Table<R> table, Field<T1> field1) {
return new MergeImpl(this, table, Arrays.asList(field1));
return new MergeImpl(configuration, table, Arrays.asList(field1));
}
/**
@ -4218,7 +4177,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2> MergeKeyStep2<R, T1, T2> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2) {
return new MergeImpl(this, table, Arrays.asList(field1, field2));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2));
}
/**
@ -4244,7 +4203,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3> MergeKeyStep3<R, T1, T2, T3> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3));
}
/**
@ -4270,7 +4229,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4> MergeKeyStep4<R, T1, T2, T3, T4> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4));
}
/**
@ -4296,7 +4255,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5> MergeKeyStep5<R, T1, T2, T3, T4, T5> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5));
}
/**
@ -4322,7 +4281,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6> MergeKeyStep6<R, T1, T2, T3, T4, T5, T6> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6));
}
/**
@ -4348,7 +4307,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7> MergeKeyStep7<R, T1, T2, T3, T4, T5, T6, T7> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7));
}
/**
@ -4374,7 +4333,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8> MergeKeyStep8<R, T1, T2, T3, T4, T5, T6, T7, T8> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8));
}
/**
@ -4400,7 +4359,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9> MergeKeyStep9<R, T1, T2, T3, T4, T5, T6, T7, T8, T9> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9));
}
/**
@ -4426,7 +4385,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> MergeKeyStep10<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10));
}
/**
@ -4452,7 +4411,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> MergeKeyStep11<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11));
}
/**
@ -4478,7 +4437,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> MergeKeyStep12<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12));
}
/**
@ -4504,7 +4463,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> MergeKeyStep13<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13));
}
/**
@ -4530,7 +4489,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> MergeKeyStep14<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14));
}
/**
@ -4556,7 +4515,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> MergeKeyStep15<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15));
}
/**
@ -4582,7 +4541,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> MergeKeyStep16<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16));
}
/**
@ -4608,7 +4567,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> MergeKeyStep17<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17));
}
/**
@ -4634,7 +4593,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> MergeKeyStep18<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18));
}
/**
@ -4660,7 +4619,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> MergeKeyStep19<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19));
}
/**
@ -4686,7 +4645,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> MergeKeyStep20<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20));
}
/**
@ -4712,7 +4671,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> MergeKeyStep21<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21));
}
/**
@ -4738,7 +4697,7 @@ public class Executor implements Configuration {
@Generated("This method was generated using jOOQ-tools")
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> MergeKeyStep22<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21, Field<T22> field22) {
return new MergeImpl(this, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22));
return new MergeImpl(configuration, table, Arrays.asList(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22));
}
// [jooq-tools] END [merge]
@ -4775,7 +4734,7 @@ public class Executor implements Configuration {
*/
@Support({ CUBRID, DB2, H2, HSQLDB, ORACLE, SQLSERVER, SYBASE })
public final <R extends Record> MergeKeyStepN<R> mergeInto(Table<R> table, Collection<? extends Field<?>> fields) {
return new MergeImpl(this, table, fields);
return new MergeImpl(configuration, table, fields);
}
/**
@ -4786,7 +4745,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> DeleteQuery<R> deleteQuery(Table<R> table) {
return new DeleteQueryImpl<R>(this, table);
return new DeleteQueryImpl<R>(configuration, table);
}
/**
@ -4802,7 +4761,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> DeleteWhereStep<R> delete(Table<R> table) {
return new DeleteImpl<R>(this, table);
return new DeleteImpl<R>(configuration, table);
}
// -------------------------------------------------------------------------
@ -4826,7 +4785,7 @@ public class Executor implements Configuration {
*/
@Support
public final Batch batch(Query... queries) {
return new BatchMultiple(this, queries);
return new BatchMultiple(configuration, queries);
}
/**
@ -4881,7 +4840,7 @@ public class Executor implements Configuration {
*/
@Support
public final BatchBindStep batch(Query query) {
return new BatchSingle(this, query);
return new BatchSingle(configuration, query);
}
/**
@ -4927,7 +4886,7 @@ public class Executor implements Configuration {
*/
@Support
public final Batch batchStore(UpdatableRecord<?>... records) {
return new BatchCRUD(this, Action.STORE, records);
return new BatchCRUD(configuration, Action.STORE, records);
}
/**
@ -4951,7 +4910,7 @@ public class Executor implements Configuration {
*/
@Support
public final Batch batchInsert(UpdatableRecord<?>... records) {
return new BatchCRUD(this, Action.INSERT, records);
return new BatchCRUD(configuration, Action.INSERT, records);
}
/**
@ -4975,7 +4934,7 @@ public class Executor implements Configuration {
*/
@Support
public final Batch batchUpdate(UpdatableRecord<?>... records) {
return new BatchCRUD(this, Action.UPDATE, records);
return new BatchCRUD(configuration, Action.UPDATE, records);
}
/**
@ -5033,7 +4992,7 @@ public class Executor implements Configuration {
*/
@Support
public final Batch batchDelete(UpdatableRecord<?>... records) {
return new BatchCRUD(this, Action.DELETE, records);
return new BatchCRUD(configuration, Action.DELETE, records);
}
/**
@ -5075,7 +5034,7 @@ public class Executor implements Configuration {
*/
@Support
public final <R extends Record> Truncate<R> truncate(Table<R> table) {
return new TruncateImpl<R>(this, table);
return new TruncateImpl<R>(configuration, table);
}
// -------------------------------------------------------------------------
@ -5261,7 +5220,7 @@ public class Executor implements Configuration {
}
finally {
getRenderMapping(getSettings()).setDefaultSchema(schema.getName());
getSchemaMapping().use(schema);
configuration.getSchemaMapping().use(schema);
}
return result;
@ -5294,7 +5253,7 @@ public class Executor implements Configuration {
* @return The new record
*/
public final <R extends UDTRecord<R>> R newRecord(UDT<R> type) {
return Utils.newRecord(type, this);
return Utils.newRecord(type, configuration);
}
/**
@ -5310,7 +5269,7 @@ public class Executor implements Configuration {
* @return The new record
*/
public final <R extends Record> R newRecord(Table<R> table) {
return Utils.newRecord(table, this);
return Utils.newRecord(table, configuration);
}
/**
@ -5355,7 +5314,7 @@ public class Executor implements Configuration {
* @return The new result
*/
public final <R extends Record> Result<R> newResult(Table<R> table) {
return new ResultImpl<R>(this, table.fields());
return new ResultImpl<R>(configuration, table.fields());
}
// -------------------------------------------------------------------------
@ -5375,7 +5334,7 @@ public class Executor implements Configuration {
final Configuration previous = Utils.getConfiguration(query);
try {
query.attach(this);
query.attach(configuration);
return query.fetch();
}
finally {
@ -5396,7 +5355,7 @@ public class Executor implements Configuration {
final Configuration previous = Utils.getConfiguration(query);
try {
query.attach(this);
query.attach(configuration);
return query.fetchLazy();
}
finally {
@ -5417,7 +5376,7 @@ public class Executor implements Configuration {
final Configuration previous = Utils.getConfiguration(query);
try {
query.attach(this);
query.attach(configuration);
return query.fetchMany();
}
finally {
@ -5439,7 +5398,7 @@ public class Executor implements Configuration {
final Configuration previous = Utils.getConfiguration(query);
try {
query.attach(this);
query.attach(configuration);
return query.fetchOne();
}
finally {
@ -5485,7 +5444,7 @@ public class Executor implements Configuration {
final Configuration previous = Utils.getConfiguration(query);
try {
query.attach(this);
query.attach(configuration);
return query.execute();
}
finally {

View File

@ -50,6 +50,7 @@ import java.util.Collection;
import java.util.List;
import org.jooq.Condition;
import org.jooq.Configuration;
import org.jooq.Field;
import org.jooq.InsertQuery;
import org.jooq.Loader;
@ -123,8 +124,8 @@ class LoaderImpl<R extends TableRecord<R>> implements
private int stored;
private final List<LoaderError> errors;
LoaderImpl(Executor create, Table<R> table) {
this.create = create;
LoaderImpl(Configuration configuration, Table<R> table) {
this.create = new Executor(configuration);
this.table = table;
this.errors = new ArrayList<LoaderError>();
}

View File

@ -47,6 +47,7 @@ import java.util.List;
import java.util.Map;
import org.jooq.Catalog;
import org.jooq.Configuration;
import org.jooq.ConnectionProvider;
import org.jooq.DataType;
import org.jooq.Meta;
@ -72,16 +73,18 @@ class MetaImpl implements Meta, Serializable {
*/
private static final long serialVersionUID = 3582980783173033809L;
private final Executor executor;
private final Executor create;
private final Configuration configuration;
private transient volatile DatabaseMetaData meta;
MetaImpl(Executor executor) {
this.executor = executor;
MetaImpl(Configuration configuration) {
this.create = new Executor(configuration);
this.configuration = configuration;
}
private final DatabaseMetaData meta() {
if (meta == null) {
ConnectionProvider provider = executor.getConnectionProvider();
ConnectionProvider provider = configuration.getConnectionProvider();
Connection connection = null;
try {
@ -103,7 +106,7 @@ class MetaImpl implements Meta, Serializable {
public final List<Catalog> getCatalogs() {
try {
List<Catalog> result = new ArrayList<Catalog>();
Result<Record> catalogs = executor.fetch(meta().getCatalogs());
Result<Record> catalogs = create.fetch(meta().getCatalogs());
for (String name : catalogs.getValues(0, String.class)) {
result.add(new MetaCatalog(name));
@ -158,7 +161,7 @@ class MetaImpl implements Meta, Serializable {
public final List<Schema> getSchemas() {
try {
List<Schema> result = new ArrayList<Schema>();
Result<Record> schemas = executor.fetch(meta().getSchemas());
Result<Record> schemas = create.fetch(meta().getSchemas());
for (String name : schemas.getValues(0, String.class)) {
result.add(new MetaSchema(name));
@ -199,7 +202,7 @@ class MetaImpl implements Meta, Serializable {
try {
List<Table<?>> result = new ArrayList<Table<?>>();
Result<Record> tables = executor.fetch(meta().getTables(null, getName(), "%", null));
Result<Record> tables = create.fetch(meta().getTables(null, getName(), "%", null));
for (Record table : tables) {
// String catalog = table.getValue(0, String.class);
@ -226,7 +229,7 @@ class MetaImpl implements Meta, Serializable {
// SQLite JDBC's DatabaseMetaData.getColumns() can only return a single
// table's columns
if (columnCache == null && executor.getDialect() != SQLITE) {
if (columnCache == null && configuration.getDialect() != SQLITE) {
columnCache = getColumns0("%").intoGroups(fieldByName(String.class, "TABLE_NAME"));
}
@ -239,7 +242,7 @@ class MetaImpl implements Meta, Serializable {
}
private final Result<Record> getColumns0(String tableName) throws SQLException {
return executor.fetch(
return create.fetch(
meta().getColumns(null, null, tableName, "%"),
// Work around a bug in the SQL Server JDBC driver by
@ -286,7 +289,7 @@ class MetaImpl implements Meta, Serializable {
// TODO: Exception handling should be moved inside SQLDataType
DataType<?> type = null;
try {
type = DefaultDataType.getDataType(executor.getDialect(), typeName, precision, scale);
type = DefaultDataType.getDataType(configuration.getDialect(), typeName, precision, scale);
if (type.hasPrecision()) {
type = type.precision(precision);

View File

@ -94,7 +94,7 @@ public class SettingsTest {
assertEquals("\"T\"", create1.render(table));
Executor create2 = new Executor(SQLDialect.ORACLE);
create2.getSettings().setRenderSchema(false);
create2.configuration().getSettings().setRenderSchema(false);
assertEquals("\"T\"", create2.render(table));
}
@ -104,7 +104,7 @@ public class SettingsTest {
assertEquals("\"TABLEX\"", create1.render(TABLE1));
Executor create2 = new Executor(SQLDialect.ORACLE);
create2.getSettings().setRenderMapping(mapping());
create2.configuration().getSettings().setRenderMapping(mapping());
assertEquals("\"TABLEX\"", create2.render(TABLE1));
}