[#1818] SQL Server "cannot insert explicit value for identity column
when IDENTITY_INSERT is set to OFF." - Added test case
This commit is contained in:
parent
83f5bf8388
commit
bac4bb1178
@ -754,6 +754,27 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, I, IPK, T658,
|
||||
assertNull(book.getValue(TBook_PUBLISHED_IN()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecordFromWithIdentity() throws Exception {
|
||||
if (TIdentityPK() == null) {
|
||||
log.info("SKIPPING", "Reflection with IDENTITY tests");
|
||||
return;
|
||||
}
|
||||
|
||||
jOOQAbstractTest.reset = false;
|
||||
|
||||
// [#1818] SQL Server doesn't like inserting IDENTITY values...
|
||||
IPK record = create().newRecord(TIdentityPK(), new Identity());
|
||||
assertEquals(10, (int) record.getValue(TIdentityPK_ID()));
|
||||
assertEquals(11, (int) record.getValue(TIdentityPK_VAL()));
|
||||
assertEquals(1, record.store());
|
||||
}
|
||||
|
||||
static class Identity {
|
||||
public int id = 10;
|
||||
public int val = 11;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecordFromUpdatePK() throws Exception {
|
||||
|
||||
|
||||
@ -1082,6 +1082,11 @@ public abstract class jOOQAbstractTest<
|
||||
new FetchTests(this).testRecordFromWithoutAnnotations();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecordFromWithIdentity() throws Exception {
|
||||
new FetchTests(this).testRecordFromWithIdentity();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecordFromUpdatePK() throws Exception {
|
||||
new FetchTests(this).testRecordFromUpdatePK();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user