Actually I see the documentation says: Every custom mapper instance can be injected in the generated class when you build it from--Selma
. This allows custom mappers to use some services of your application code.
But there are no exemple in the sample project.
On Wednesday, February 22, 2017 at 9:39:52 PM UTC+1, tehb...@gmail.com wrote:Hey there,I've 2 beanspublic class PersonDTO { private String name; private String compagnyName; }public class Person { private String name; private String compagnyKey; }My regular factory code would be@Servicepublic class PersonFactory {@Autowired private IConfigurationService conf;public PersonDto convertPersonToPersonDto(Person origine) {PersonDTO result = new PersonDTO();result.setName(origine.getName();result.setCompagny(conf.findCompagnyName(origine.getCompagnyKey));}}So I created a SelmaMapper@Mapper(withIgnoreFields = "compagnyName", withCustom = SelmaCustomMapper.class, withIoC = IoC.SPRING) public interface SelmaMapper {PersonDto asPersonDto(Person source);}But is there a way to get the IConfigurationService conf injected into SelmaCustomMapper?
You received this message because you are subscribed to the Google Groups "Selma" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selma-java+unsubscribe@googlegroups.com.
To post to this group, send email to selma...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selma-java/bfc7f57d-2d92-4262-ad41-3fa93596d223%40googlegroups.com.
156, boulevard Haussmann, 75008 Paris +33(0)6 19 61 81 17 / slem...@xebia.fr | ![]() |