title: JAXB objects - hashcode and equals
body: <p>We have a huge java application that entirely works based on JAXB serialization.The middleware server does all db access and sends all the data Objects in JAXB objects and serializes to  XML and sends the data to  UI ( C#.Net).</p>
  
  <p>Most of the times after the data is populated from db access into the JAXB java objects , I will have to some processing like "sort the collection of objects based on attribute" , find the avg , do some calculation on  the list of objects in the collection etc.</p>
  
  <p>My major problem is, JAXB objects don't have equals and hashcode. So what I am doing is moving all the data to some user defined Data objects where I have hashcode, equals, compareTo defined so I can do all operations in the collections and then copy to the JAXB objects. I think this is a extra overhead.</p>
  
  <p>Questions:</p>
  
  <p>1) does jaxb objects support equals /hashcode/ compareTo - can I specifiy these in schema?</p>
  
  <p>2) Any other better alternatives?</p>
  
  <p>Thanks. </p>