- All Implemented Interfaces:
Serializable
, Comparable<CacheId>
Defines a wrapper for a primary key (Id) to use as a key in the cache.
- Since:
- EclipseLink 2.1
- See Also:
-
-
Field Summary
Fields
protected boolean
Indicates whether at least one element of primaryKey is array.
protected int
-
Constructor Summary
Constructors
-
Method Summary
void
Append the value to the end of the primary key values.
int
Determine if the receiver is greater or less than the key.
protected int
Pre-compute the hash to optimize hash calls.
boolean
Determine if the receiver is equal to anObject.
boolean
Determine if the receiver is equal to key.
boolean
int
Return the precomputed hashcode.
void
Set the value in the primary key values.
void
-
Field Details
-
-
primaryKey
The primary key values.
-
hash
protected int hash
Cached hashcode.
-
hasArray
protected boolean hasArray
Indicates whether at least one element of primaryKey is array.
-
Constructor Details
-
-
CacheId
public CacheId(Object[] primaryKey)
-
Method Details
-
getPrimaryKey
public Object[] getPrimaryKey()
-
setPrimaryKey
public void setPrimaryKey(Object[] primaryKey)
-
add
Append the value to the end of the primary key values.
-
set
public void set(int index,
Object value)
Set the value in the primary key values.
-
computeHash
protected int computeHash(Object[] primaryKey)
Pre-compute the hash to optimize hash calls.
-
hashCode
public int hashCode()
Return the precomputed hashcode.
- Overrides:
hashCode
in class Object
-
equals
public boolean equals(Object object)
Determine if the receiver is equal to anObject.
If anObject is a CacheKey, do further comparison, otherwise, return false.
- Overrides:
equals
in class Object
- See Also:
-
-
equals
Determine if the receiver is equal to key.
Use an index compare, because it is much faster than enumerations.
-
-
hasArray
public boolean hasArray()
-