Added an additional INSERT .. SET .. RETURNING test case

This commit is contained in:
Lukas Eder 2012-03-10 09:27:50 +00:00
parent c82d28a0fe
commit 45b9d5808c
2 changed files with 16 additions and 5 deletions

View File

@ -506,6 +506,17 @@ extends BaseTest<A, B, S, B2S, BS, L, X, DATE, D, T, U, I, IPK, T658, T725, T639
assertEquals( ID, (int) returned.getValue(TTriggers_ID()));
assertEquals(2*ID, (int) returned.getValue(TTriggers_COUNTER()));
// Alternative syntax
// ------------------
returned = create().insertInto(TTriggers())
.set(TTriggers_COUNTER(), 0)
.returning(TTriggers_ID_GENERATED())
.fetchOne();
assertNotNull(returned);
assertEquals(++ID, (int) returned.getValue(TTriggers_ID_GENERATED()));
assertNull(returned.getValue(TTriggers_ID()));
assertNull(returned.getValue(TTriggers_COUNTER()));
switch (getDialect()) {
case ASE:
case DERBY:

View File

@ -992,6 +992,11 @@ public abstract class jOOQAbstractTest<
new InsertUpdateTests(this).testInsertOnDuplicateKey();
}
@Test
public void testInsertReturning() throws Exception {
new InsertUpdateTests(this).testInsertReturning();
}
@Test
public void testMerge() throws Exception {
new InsertUpdateTests(this).testMerge();
@ -1037,11 +1042,6 @@ public abstract class jOOQAbstractTest<
new CRUDTests(this).testNonUpdatables();
}
@Test
public void testInsertReturning() throws Exception {
new InsertUpdateTests(this).testInsertReturning();
}
@Test
public void testFormatHTML() throws Exception {
new FormatTests(this).testFormatHTML();