O'Reilly logo

Java™ Data Objects by Robin M. Roos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.7. JDO identity

Some form of persistent object identity is required for each instance. Applications use this to retrieve specific instances from the data store. Object identity can also be used to maintain uniqueness constraints over the domain objects where this is warranted (e.g. no two orders with the same order number).

In the Java language there are two forms of identity: equality and equivalence.

Equality is used to determine whether two Java references actually point to the same object in memory, and makes use of the == operator. Equality does not take into account the state (attribute values) of an object and cannot traverse JVM processes in distributed applications. As such it is limited in its application.

Equivalence compares two ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required