简体   繁体   中英

Dozer Mapping - Map elements to child class instead of parent class

I have base class orderItem and have child classes DeviceItem and ServiceItem. I have provided the definition below. When I get this request I perform dozer mapping to translate this for jaxb model to another data model that I have created. My data model also has same OrderItem , DerviceItem and DeviceItem classes which are POJOs. When I do a dozer mapping , the classes get mapped to OrderItem (base class) instead of specialized child classes. Is there a way to perform this user dozer mapping?

<ns2:orderItem xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:type = "ns2:ServiceItem">

通过提供提示,我能够按照此链接中的步骤解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM