Search in sources :

Example 1 with HibernateFlowEventDump

use of org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventDump in project open-kilda by telstra.

the class HibernateHistoryFlowEventRepository method makeEntity.

@Override
protected HibernateFlowEvent makeEntity(FlowEventData view) {
    HibernateFlowEvent entity = new HibernateFlowEvent();
    FlowEventCloner.INSTANCE.copyWithoutRecordsAndDumps(view, entity);
    for (FlowEventAction entry : view.getEventActions()) {
        HibernateFlowEventAction action = new HibernateFlowEventAction();
        FlowEventActionCloner.INSTANCE.copy(entry.getData(), action);
        entity.addAction(action);
    }
    for (FlowEventDump entry : view.getEventDumps()) {
        HibernateFlowEventDump dump = new HibernateFlowEventDump();
        FlowEventDumpCloner.INSTANCE.copy(entry.getData(), dump);
        entity.addDump(dump);
    }
    return entity;
}
Also used : HibernateFlowEventAction(org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventAction) HibernateFlowEventDump(org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventDump) HibernateFlowEventAction(org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventAction) FlowEventAction(org.openkilda.model.history.FlowEventAction) HibernateFlowEvent(org.openkilda.persistence.hibernate.entities.history.HibernateFlowEvent) FlowEventDump(org.openkilda.model.history.FlowEventDump) HibernateFlowEventDump(org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventDump)

Example 2 with HibernateFlowEventDump

use of org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventDump in project open-kilda by telstra.

the class HibernateHistoryFlowEventDumpRepository method makeEntity.

@Override
protected HibernateFlowEventDump makeEntity(FlowEventDumpData view) {
    HibernateFlowEventDump entity = new HibernateFlowEventDump();
    FlowEventDumpCloner.INSTANCE.copy(view, entity);
    entity.setEvent(flowEventRepository.findEntityByTaskId(view.getTaskId()).orElse(null));
    return entity;
}
Also used : HibernateFlowEventDump(org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventDump)

Aggregations

HibernateFlowEventDump (org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventDump)2 FlowEventAction (org.openkilda.model.history.FlowEventAction)1 FlowEventDump (org.openkilda.model.history.FlowEventDump)1 HibernateFlowEvent (org.openkilda.persistence.hibernate.entities.history.HibernateFlowEvent)1 HibernateFlowEventAction (org.openkilda.persistence.hibernate.entities.history.HibernateFlowEventAction)1