Apache JDO Project - Question on TCK11

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > June 2005 > Question on TCK11





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Question on TCK11
Geoff hendrey

2005-06-06, 7:49 am

Department.hashCode method is using a persistent field
to compute the value of the hashcode, in TCK11. Note
that in the Sun version of the TCK, which JDOMax
passes, hashCode is NOT overidden for Department.

I think it is wrong to override hashCode and equals
for any class using datastore identity. This was the
subject of 35 or so emails on the experts group, and
this was the position espoused by Craig.

Craig laid down the law:
"If you don't have a set of fields that uniquely form
an application identity, then you should not implement
equals. You *should* delegate to Object.equals"

Please let me know if an implementation is expected to
handle cases when the user overides equals and
hashCode for datastore identity? Certainly, JDOMax
does NOT, and is failing a good bit of the Apache
TCK11 because of it!

-geoff



__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail

Craig Russell

2005-06-06, 7:49 am

Craig Russell

2005-06-06, 7:49 am

Geoff hendrey

2005-06-06, 7:49 am


> The classes in question have a set of fields that
> uniquely form an
> application identity, and hashCode and equals use
> these fields. I don't
> see the issue.


DatastoreIdentity is used, so no, they don't form an
application identity.

-geoff








Discover Yahoo!
Find restaurants, movies, travel and more fun for the weekend. Check it out!
http://discover.yahoo.com/weekend.html


Geoff hendrey

2005-06-06, 7:49 am

The test in question used DatastoreIdentity.

you said:

"The classes in question have a set of fields that
uniquely form an *application identity*" and I'm just
saying no, they don't form an *application identity*,
because this test doesn't use application identity. It
uses Datastore Identity.

Ho hum, I guess I'm just grumpy because I didn't
expect the Apache TCK to be so different from the Sun
TCK.

-geoff


--- Craig Russell <Craig.Russell@Sun.COM> wrote:

> Hi Geoff,
>
> It sounds like you are confusing application
> equality with JDO
> identity, which are two separate concepts.
>
> JVM has identity that you test with a == b.
>
> Applications have equality that you test with
> a.equals(b).
>
> JDO has identity that you test with
> a.getObjectId().equals(b.getObjectId()).
>
> Three different concepts.
>
> Craig
>
> On May 21, 2005, at 6:37 PM, Geoff hendrey wrote:
>
> an
> the weekend. Check
> Craig Russell
> Architect, Sun Java Enterprise System
> http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>





Discover Yahoo!
Use Yahoo! to plan a weekend, have fun online and more. Check it out!
http://discover.yahoo.com/

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com