Hi Mark,
which version are you using? Have you tried the CVS version of Castor?
If it is still not working, send me your XML Schema (as an XML document) so that
we can add this bug to our to-do list.
Thanks,
Arnaud
> -----Original Message-----
> From: Mark Ralph [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 24, 2001 11:40 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Problems with generated equals methods
>
> We are using the equals methods generated by castor, and are finding a few problems
> One such problem is in the generated class below. A screenshot from XML Spy showing
>the schema structure is also attached.
>
> << File: schema example1.gif >>
>
> The problem is that this equals implementation will return true whenever the
>optional class attribute '_travel' is null, even if the argument object's attribute
>is non-null.
> Is this a known problem ? and is there a fix
>
> kind thanks,
>
> Mark Ralph
> Chief Technology Officer
>
> ------------------------------
> BSIS Digital Consulting
> ------------------------------
> p| +61 8 9389 9466 -x106 |
> f| +61 8 9389 9366 |
> m| 0418 919 617 |
> e| [EMAIL PROTECTED] |
> w| http://www.bsis.com.au/ |
> c| ABN 55 082 541 437 |
> ------------------------------
>
>
>
>----------------------------------------------------------------------------------------------
> SNIPPETT STARTS
>
>----------------------------------------------------------------------------------------------
>
> public class TGuestMainRevise extends TPersonMainRevise
> implements java.io.Serializable
> {
>
> private TGuestTravelInfo _travel;
>
> public TGuestMainRevise()
> {
> super();
> } //-- com.mic.tds.api.business.objects.apitypes.TGuestMainRevise()
>
> /**
> * Note: hashCode() has not been overriden
> * @param obj
> **/
> public boolean equals(java.lang.Object obj)
> {
> if ( this == obj )
> return true;
>
> if (super.equals(obj)==false)
> return false;
>
> if (obj instanceof TGuestMainRevise)
> {
>
> TGuestMainRevise temp = (TGuestMainRevise)obj;
> if ( (this._travel != null) &&!(this._travel.equals(temp._travel)))
> return false;
> return true;
> }
> return false;
> } //-- boolean equals(java.lang.Object)
>
> /**
> **/
> public TGuestTravelInfo getTravel()
> {
> return this._travel;
> } //-- TGuestTravelInfo getTravel()
>
> /**
> *
> * @param travel
> **/
> public void setTravel(TGuestTravelInfo travel)
> {
> this._travel = travel;
> } //-- void setTravel(TGuestTravelInfo)
>
> }
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev