package com.bytesw.bytebot.service;

import com.bytesw.bytebot.bean.CalendarBean;
import com.bytesw.bytebot.bean.ProcessETLBean;
import com.bytesw.bytebot.model.Calendar;
import com.bytesw.bytebot.model.ProcessETL;
import com.bytesw.bytebot.repository.ProcessETLRepository;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class ProcessETLService extends XDFService<ProcessETL, ProcessETLBean, Integer> {

    protected ProcessETLService(ProcessETLRepository repository) {
        super(repository);
    }

    @Override
    protected ProcessETL toModel(ProcessETL model, ProcessETLBean bean) {
        if (model == null) {
            model = new ProcessETL();
        }
        BeanUtils.copyProperties(bean, model);
        return model;
    }

    @Override
    protected ProcessETLBean toBean(ProcessETL model) {
        ProcessETLBean bean = new ProcessETLBean();
        BeanUtils.copyProperties(model, bean);
        return bean;
    }

}
