public interface ObjectIdentity extends Serializable
As implementations are used as the key for caching and lookup, it is
essential that implementations provide methods so that object-equality
rather than reference-equality can be relied upon by caches. In other
words, a cache can consider two ObjectIdentity
s equal if
identity1.equals(identity2)
, rather than reference-equality of
identity1==identity2
.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Refer to the
java.lang.Object documentation for the interface contract. |
Serializable |
getIdentifier()
Obtains the actual identifier.
|
Class |
getJavaType()
Obtains the Java type represented by the domain object.
|
int |
hashCode()
Refer to the
java.lang.Object documentation for the interface contract. |
boolean equals(Object obj)
java.lang.Object
documentation for the interface contract.Serializable getIdentifier()
javaType
.Because ACLs are largely immutable, it is strongly recommended to use a synthetic identifier (such as a database sequence number for the primary key). Do not use an identifier with business meaning, as that business meaning may change.
javaType
Class getJavaType()
Copyright © 2019. All rights reserved.