use of org.apache.cayenne.testdo.mt.ClientMtTable1Subclass1 in project cayenne by apache.
the class ValueInjectorIT method testClient.
@Test
public void testClient() {
ObjectContext context = createROPContext();
ObjEntity entity = context.getEntityResolver().getObjEntity(ClientMtTable1Subclass1.class);
Expression qualifier = entity.getDeclaredQualifier();
try {
ClientMtTable1Subclass1 ee = context.newObject(ClientMtTable1Subclass1.class);
assertEquals(ee.getGlobalAttribute1(), "sub1");
// check AND
entity.setDeclaredQualifier(qualifier.andExp(ExpressionFactory.exp("serverAttribute1 = 'sa'")));
ee = context.newObject(ClientMtTable1Subclass1.class);
assertEquals(ee.getGlobalAttribute1(), "sub1");
assertEquals(ee.getServerAttribute1(), "sa");
} finally {
entity.setDeclaredQualifier(qualifier);
}
}
Aggregations