use of org.apache.cayenne.testdo.extended_type.StringET1 in project cayenne by apache.
the class DataContextExtendedTypeOperationsIT method testInExpressionExtendedTypeArray.
@Test
public void testInExpressionExtendedTypeArray() {
ExtendedTypeEntity e1 = context.newObject(ExtendedTypeEntity.class);
e1.setName(new StringET1("X"));
ExtendedTypeEntity e2 = e1.getObjectContext().newObject(ExtendedTypeEntity.class);
e2.setName(new StringET1("Y"));
ExtendedTypeEntity e3 = e1.getObjectContext().newObject(ExtendedTypeEntity.class);
e3.setName(new StringET1("Z"));
e1.getObjectContext().commitChanges();
Expression in = ExtendedTypeEntity.NAME.in(new StringET1("X"), new StringET1("Y"));
SelectQuery query = new SelectQuery(ExtendedTypeEntity.class, in);
assertEquals(2, e1.getObjectContext().performQuery(query).size());
}
use of org.apache.cayenne.testdo.extended_type.StringET1 in project cayenne by apache.
the class DataContextExtendedTypeOperationsIT method testInExpressionExtendedTypeList.
@Test
public void testInExpressionExtendedTypeList() {
ExtendedTypeEntity e1 = context.newObject(ExtendedTypeEntity.class);
e1.setName(new StringET1("X"));
ExtendedTypeEntity e2 = e1.getObjectContext().newObject(ExtendedTypeEntity.class);
e2.setName(new StringET1("Y"));
ExtendedTypeEntity e3 = e1.getObjectContext().newObject(ExtendedTypeEntity.class);
e3.setName(new StringET1("Z"));
e1.getObjectContext().commitChanges();
Expression in = ExtendedTypeEntity.NAME.in(Arrays.asList(new StringET1("X"), new StringET1("Y")));
SelectQuery query = new SelectQuery(ExtendedTypeEntity.class, in);
assertEquals(2, e1.getObjectContext().performQuery(query).size());
}
use of org.apache.cayenne.testdo.extended_type.StringET1 in project cayenne by apache.
the class DataContextExtendedTypeOperationsIT method testStoreExtendedType.
@Test
public void testStoreExtendedType() {
ExtendedTypeEntity e1 = context.newObject(ExtendedTypeEntity.class);
e1.setName(new StringET1("X"));
e1.getObjectContext().commitChanges();
SQLTemplate checkQ = new SQLTemplate(ExtendedTypeEntity.class, "SELECT * FROM EXTENDED_TYPE_TEST WHERE NAME = 'X'");
checkQ.setFetchingDataRows(true);
checkQ.setColumnNamesCapitalization(CapsStrategy.UPPER);
assertEquals(1, e1.getObjectContext().performQuery(checkQ).size());
}
Aggregations