package com.cim.idm.mwmsextend.checkplan.management.action.util;

import org.springframework.stereotype.Component;

import com.cim.idm.framework.orm.service.CommonHistoryDataAdaptor;
import com.cim.idm.mwmsextend.checkplan.management.data.CheckPlan;
import com.cim.idm.mwmsextend.checkplan.management.data.CheckPlanHistory;
import com.cim.idm.mwmsextend.checkplan.management.data.CheckPlanHistoryKey;

@Component
public class CheckPlanHistoryDataAdaptor extends
	CommonHistoryDataAdaptor<CheckPlan,CheckPlanHistoryKey,CheckPlanHistory>{

	@Override
	protected CheckPlanHistoryKey getHistoryKey(CheckPlan arg0) {
		CheckPlanHistoryKey key = new CheckPlanHistoryKey();
		key.setPlanDate(arg0.getKey().getPlanDate());
		key.setCheckPlanName(arg0.getKey().getCheckPlanName());
		key.setSiteName(arg0.getKey().getSiteName());
		key.setMaterialPackingName(arg0.getKey().getMaterialPackingName());
		key.setTimeKey(arg0.getLastEventTimeKey());
		
		return key;
	}

}
