如何在 jaxws 中使用 wsimport 生成 equals() 和 hashcode() 方法 [英] How to generate equals() and hashcode() methods using wsimport in jaxws

查看:28
本文介绍了如何在 jaxws 中使用 wsimport 生成 equals() 和 hashcode() 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 wsimport 从我的 WSDL 生成的类没有 equals()hashcode() 方法.如何自定义和生成客户端类以获取 equals()hashcode() 方法.

The generated classes from my WSDL using wsimport are not having equals() and hashcode() methods. How can I customize and generate the client classes to get equals() and hashcode() methods.

我不确定使用 JAXB 来实现这一点.

I am not sure about using JAXB to achieve this.

在 Axis2.0 生成的存根中生成了这些方法,但不确定为什么 JAXWS 中没有这样的基本方法!

In Axis2.0 generated stubs these methods are generated but not sure why such a basic thing is not available in JAXWS!

推荐答案

您可以使用 JAXB2 Basics Plugin 生成 equals()hashcode() 方法:

You can use the JAXB2 Basics Plugin to generate equals() and hashcode() methods:

这篇关于如何在 jaxws 中使用 wsimport 生成 equals() 和 hashcode() 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆