简体   繁体   English

使用Web Service客户端生成的工件映射Pojo实体

[英]Mapping pojo entities with web service client generated artifacts

I have create a simple webservice in java returning a POJO. 我已经在Java中创建了一个简单的Web服务,并返回了POJO。 I'm using this POJO from a separate JAR. 我正在使用来自单独JAR的POJO。 When i create a client of this project, netbeans creates its own version of POJO through the wsimport utility. 当我创建该项目的客户端时,netbeans通过wsimport实用程序创建其自己的POJO版本。 Obviously both POJOs (from jar and auto-generated) are different because of different package names. 显然,两个POJO(来自jar和自动生成的)由于包名不同而有所不同。

Is there any way i can map these two automatically? 有什么办法可以自动映射这两个?

You could use some mapper for that, for example Dozer . 您可以为此使用一些映射器,例如Dozer Read about its configuration, it should help you. 了解有关其配置的信息,它将为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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