Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8078141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:41:48+00:00 2026-06-05T15:41:48+00:00

I have two classes A and B generated by cxf-codegen-plugin from my WSDL. A

  • 0

I have two classes A and B generated by cxf-codegen-plugin from my WSDL. A inherits from B.

I would like to add common methods like hashCode(), equals()… So, I have the following configuration in my POM:

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>2.6.0</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${basedir}/wsdl/PeeringApi.wsdl</wsdl>
                        <extraargs>
                            <extraarg>-xjc-XhashCode</extraarg>
                            <extraarg>-xjc-Xequals</extraarg>
                            <extraarg>-xjc-Xsetters</extraarg>
                        </extraargs>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics</artifactId>
            <version>${jaxb2.version}</version>
        </dependency>
    </dependencies> </plugin>

I have two questions:

  1. Is there a way to generate an equals() method that doesn’t compare properties of B (i.e. not calling super.equals())?
  2. How to indicate to the plugin to generate an equals() method that compare only certain properties of A (by default, it seems that all the properties are compared) that I specify?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:41:50+00:00Added an answer on June 5, 2026 at 3:41 pm

    I’ve found a solution as it is explained here: http://confluence.highsource.org/display/J2B/JAXB2+Basics+Plugins.

    You can add custom bindings to indicate to JAXB2 plugins to ignore a certain property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes generated by LINQ2SQL both from the same table so they
I'm having trouble grasping generic methods. I have two classes that are generated (they
I have two classes that I would like to merge into a composite. These
I have two classes one of which inherits from the other. Im trying to
Working on my 1.6.0_16 JDK, I generated my stub classes from a WSDL using
I have two simple classes generated by code first. public class Company { public
Lets say I have two L2S classes generated by the designer with one property
I have two classes.... Parcel and FundParcel...and I'm trying to convert an IEnumerable of
I have two classes that refer to each other, but obviously the compiler complains.
I have two classes; Area and LanguageArea . I use LanguageArea to handle translated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.