use of org.apache.cayenne.joda.db.LocalTimeTestEntity in project cayenne by apache.
the class JodaModuleIT method testJodaLocalTime.
@Test
public void testJodaLocalTime() {
ObjectContext context = runtime.newContext();
LocalTimeTestEntity localTimeTestEntity = context.newObject(LocalTimeTestEntity.class);
LocalTime localTime = LocalTime.now();
localTimeTestEntity.setTime(localTime);
context.commitChanges();
LocalTimeTestEntity testRead = ObjectSelect.query(LocalTimeTestEntity.class).selectOne(context);
LocalTime time = testRead.getTime();
assertNotNull(time);
assertEquals(LocalTime.class, time.getClass());
assertEquals(localTime.getSecondOfMinute(), time.getSecondOfMinute());
assertEquals(localTime.getMinuteOfHour(), time.getMinuteOfHour());
assertEquals(localTime.getHourOfDay(), time.getHourOfDay());
}
Aggregations