use of org.apache.cayenne.testdo.java8.PeriodTestEntity in project cayenne by apache.
the class Java8TimeIT method testJava8Period.
@Test
public void testJava8Period() {
PeriodTestEntity periodTestEntity = context.newObject(PeriodTestEntity.class);
Period period = Period.of(100, 10, 5);
periodTestEntity.setPeriodField(period);
context.commitChanges();
PeriodTestEntity testRead = ObjectSelect.query(PeriodTestEntity.class).selectOne(context);
assertNotNull(testRead.getPeriodField());
assertEquals(Period.class, testRead.getPeriodField().getClass());
assertEquals(period, testRead.getPeriodField());
}
Aggregations