package com.eactive.eai.rms.onl.manage.serviceinfo.stdmessage;

import org.mapstruct.BeanMapping;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;

import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageItem;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(config = BaseMapperConfig.class)
public interface StdMessageItemUIMapper extends GenericMapper<StdMessageItemUI, StandardMessageItem> {

	@Mapping(source = "id.bzwksvckeyname", target = "bzwksvckeyname")
	@Mapping(source = "id.columnname", target = "columnname")
	@Mapping(source = "columnvalue", target = "columnvalue")
	@Override
	StdMessageItemUI toVo(StandardMessageItem entity);

	@InheritInverseConfiguration
	@Override
	StandardMessageItem toEntity(StdMessageItemUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateEntity(StdMessageItemUI ui, @MappingTarget StandardMessageItem entity);

}
