use of org.apache.cayenne.testdo.primitive.PrimitivesTestEntity in project cayenne by apache.
the class PrimitiveAttributesIT method testSelect.
@Test
public void testSelect() throws Exception {
TableHelper tPrimitives = new TableHelper(dbHelper, "PRIMITIVES_TEST");
tPrimitives.setColumns("ID", "BOOLEAN_COLUMN", "INT_COLUMN", "CHAR_COLUMN");
tPrimitives.insert(1, true, -100, String.valueOf('a')).insert(2, false, 0, String.valueOf('~')).insert(3, true, Integer.MAX_VALUE, String.valueOf('Z'));
List<PrimitivesTestEntity> result = ObjectSelect.query(PrimitivesTestEntity.class).orderBy(PrimitivesTestEntity.INT_COLUMN.asc()).select(context);
assertEquals(3, result.size());
assertEquals(-100, result.get(0).getIntColumn());
assertEquals('a', result.get(0).getCharColumn());
assertTrue(result.get(0).isBooleanColumn());
assertEquals(0, result.get(1).getIntColumn());
assertEquals('~', result.get(1).getCharColumn());
assertFalse(result.get(1).isBooleanColumn());
assertEquals(Integer.MAX_VALUE, result.get(2).getIntColumn());
assertEquals('Z', result.get(2).getCharColumn());
assertTrue(result.get(2).isBooleanColumn());
}
use of org.apache.cayenne.testdo.primitive.PrimitivesTestEntity in project cayenne by apache.
the class PrimitiveAttributesIT method testCommit.
@Test
public void testCommit() {
PrimitivesTestEntity e = context.newObject(PrimitivesTestEntity.class);
e.setBooleanColumn(true);
e.setIntColumn(88);
e.setCharColumn('B');
context.commitChanges();
}
Aggregations