Search in sources :

Example 1 with WorkbasketMapper

use of pro.taskana.mappings.WorkbasketMapper in project taskana by Taskana.

the class WorkbasketServiceImplIntAutocommitTest method updateModifiedTimestamps.

private void updateModifiedTimestamps(Workbasket basket2, Workbasket basket3, Workbasket basket4, Workbasket basket1) {
    // created and modified timestamps are set by WorkbasketServiceImpl to 'now' when the workbasket is created
    // in order to create timestamps distict from the current time, we must use the mapper directly to bypass
    // WorkbasketServiceImpl
    TaskanaEngineProxyForTest engineProxy = new TaskanaEngineProxyForTest(taskanaEngineImpl);
    SqlSession session = engineProxy.getSqlSession();
    WorkbasketMapper mapper = session.getMapper(WorkbasketMapper.class);
    WorkbasketImpl wb1 = (WorkbasketImpl) basket1;
    WorkbasketImpl wb2 = (WorkbasketImpl) basket2;
    WorkbasketImpl wb3 = (WorkbasketImpl) basket3;
    WorkbasketImpl wb4 = (WorkbasketImpl) basket4;
    engineProxy.openConnection();
    wb1.setModified(now.minus(Duration.ofDays(10L)));
    mapper.update(wb1);
    wb2.setModified(now.minus(Duration.ofDays(15L)));
    mapper.update(wb2);
    wb3.setModified(now.minus(Duration.ofDays(20L)));
    mapper.update(wb3);
    wb4.setModified(now.minus(Duration.ofDays(30L)));
    mapper.update(wb4);
    engineProxy.returnConnection();
}
Also used : WorkbasketMapper(pro.taskana.mappings.WorkbasketMapper) SqlSession(org.apache.ibatis.session.SqlSession) TaskanaEngineProxyForTest(pro.taskana.impl.TaskanaEngineProxyForTest) WorkbasketImpl(pro.taskana.impl.WorkbasketImpl)

Aggregations

SqlSession (org.apache.ibatis.session.SqlSession)1 TaskanaEngineProxyForTest (pro.taskana.impl.TaskanaEngineProxyForTest)1 WorkbasketImpl (pro.taskana.impl.WorkbasketImpl)1 WorkbasketMapper (pro.taskana.mappings.WorkbasketMapper)1