java - Orika clean MapperFactory -
i´m using spring mvc , orika mapper entities xml, problem i´m facing when try reuse mapperfactory new mappers in same instance, not dont remove previous mapper registered, after supposedly add new one, invoke in map method call, first mapper register.
here code:
@override public void configuremapper() { converterfactory converterfactory = factory.getconverterfactory(); classmapbuilder builder = factory.classmap(publicprocurement.class, requestforquotationbody.class) .mapnulls(false); (documentbodymapper<requestforquotationbody, publicprocurement> mapper : mappers) { mapper.register(builder, converterfactory); } builder.register(); } @override public void setmappers(list<documentbodymapper<requestforquotationbody, publicprocurement>> documentbodymappers) { this.mappers = documentbodymappers; }
so first time configure mapperfactor mappers list {amapper.class}, after finish create xml, invoke again passing time mappers list {bmapper.class, cmapper.class}. time when invoke map. amapper.class appear, xml regarding amapper happens.
any idea how reset mapperfactory?
finally since ´m using spring define mapper prototype , creating new instance in every transaction clean mapperfactory
Comments
Post a Comment