Search in sources :

Example 1 with TinyintTestEntity

use of org.apache.cayenne.testdo.numeric_types.TinyintTestEntity in project cayenne by apache.

the class NumericTypesIT method testTinyintInInsert.

@Test
public void testTinyintInInsert() throws Exception {
    TinyintTestEntity object = (TinyintTestEntity) (context).newObject("TinyintTestEntity");
    object.setTinyintCol((byte) 1);
    context.commitChanges();
}
Also used : TinyintTestEntity(org.apache.cayenne.testdo.numeric_types.TinyintTestEntity) Test(org.junit.Test)

Example 2 with TinyintTestEntity

use of org.apache.cayenne.testdo.numeric_types.TinyintTestEntity in project cayenne by apache.

the class NumericTypesIT method testTinyintInQualifier.

@Test
public void testTinyintInQualifier() throws Exception {
    createTinyintDataSet();
    // test
    Expression qual = ExpressionFactory.matchExp("tinyintCol", (byte) 81);
    List<?> objects = context.performQuery(new SelectQuery<>(TinyintTestEntity.class, qual));
    assertEquals(1, objects.size());
    TinyintTestEntity object = (TinyintTestEntity) objects.get(0);
    assertEquals(new Byte((byte) 81), object.getTinyintCol());
}
Also used : TinyintTestEntity(org.apache.cayenne.testdo.numeric_types.TinyintTestEntity) Expression(org.apache.cayenne.exp.Expression) Test(org.junit.Test)

Aggregations

TinyintTestEntity (org.apache.cayenne.testdo.numeric_types.TinyintTestEntity)2 Test (org.junit.Test)2 Expression (org.apache.cayenne.exp.Expression)1