"t",
"id int not null primary key",
"a int",
"b int",
"c int");
NewRow niceRow = new NiceRow(t, getRowDef(t));
int cId = 0;
int cA = 1;
int cB = 2;
int cC = 3;
// Insert longs, not integers, because Persistit stores all ints as 8-byte.
niceRow.put(cId, 0);
niceRow.put(cA, 0);
niceRow.put(cB, 0);
niceRow.put(cC, 0);
// Create initial legacy row
LegacyRowWrapper legacyRow = new LegacyRowWrapper(niceRow.getRowDef(), niceRow.toRowData());
assertEquals(0, legacyRow.get(cA));
assertEquals(0, legacyRow.get(cB));
assertEquals(0, legacyRow.get(cC));
// Apply a few updates
legacyRow.put(cA, 1);
legacyRow.put(cB, 1);
legacyRow.put(cC, 1);
// Check the updates (should be a NiceRow)
assertEquals(1, legacyRow.get(cA));
assertEquals(1, legacyRow.get(cB));
assertEquals(1, legacyRow.get(cC));
// Convert to LegacyRow and check NiceRow created from the legacy row's RowData
RowDef rowDef = getRowDef(t);
niceRow = (NiceRow) NiceRow.fromRowData(legacyRow.toRowData(), rowDef);
assertEquals(1, niceRow.get(cA));
assertEquals(1, niceRow.get(cB));
assertEquals(1, niceRow.get(cC));
// Convert back to NiceRow and check state again
legacyRow.put(cA, 2);
legacyRow.put(cB, 2);
legacyRow.put(cC, 2);
assertEquals(2, legacyRow.get(cA));