package com.eactive.eai.rms.common.cm.mapping;

import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.common.cm.ui.CmLogUI;
import com.eactive.eai.rms.data.entity.man.cm.CmLogEntity;

import org.mapstruct.*;

@Mapper(config = BaseMapperConfig.class)
public abstract class CmLogUIMapper implements GenericMapper<CmLogUI, CmLogEntity> {

   @Override
   public abstract CmLogUI toVo(CmLogEntity entity);

   @InheritInverseConfiguration(name = "toVo")
   @Override
   public abstract CmLogEntity toEntity(CmLogUI vo);

   @InheritConfiguration
   @Mapping(target = "cmLogDetail2Entities", ignore = true)
   public abstract CmLogUI toVoWithoutChildren(CmLogEntity entity);

//   @InheritConfiguration
//   @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
//   public abstract void updateEntity(CmLogUI cmLogUI, @MappingTarget CmLog2Entity cmLog2Entity);

}