use of org.apache.cayenne.testdo.enum_test.EnumEntity in project cayenne by apache.
the class EnumIT method testInsert.
@Test
public void testInsert() {
EnumEntity e = context.newObject(EnumEntity.class);
e.setEnumAttribute(Enum1.one);
context.commitChanges();
}
use of org.apache.cayenne.testdo.enum_test.EnumEntity in project cayenne by apache.
the class EnumIT method testSelectQuery.
@Test
public void testSelectQuery() throws Exception {
createDataSet();
SelectQuery q = new SelectQuery(EnumEntity.class);
q.andQualifier(EnumEntity.ENUM_ATTRIBUTE.eq(Enum1.one));
EnumEntity e = (EnumEntity) Cayenne.objectForQuery(context, q);
assertNotNull(e);
assertSame(Enum1.one, e.getEnumAttribute());
}
use of org.apache.cayenne.testdo.enum_test.EnumEntity in project cayenne by apache.
the class EnumIT method testSQLTemplate.
@Test
public void testSQLTemplate() throws Exception {
createDataSet();
SQLTemplate q = new SQLTemplate(EnumEntity.class, "SELECT * FROM ENUM_ENTITY WHERE ENUM_ATTRIBUTE = 'one'");
q.setColumnNamesCapitalization(CapsStrategy.UPPER);
EnumEntity e = (EnumEntity) Cayenne.objectForQuery(context, q);
assertNotNull(e);
assertSame(Enum1.one, e.getEnumAttribute());
}
Aggregations