|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.jdo.identity.SingleFieldIdentity
public abstract class SingleFieldIdentity
This class is the abstract base class for all single field identity classes. A common case of application identity uses exactly one persistent field in the class to represent identity. In this case, the application can use a standard JDO class instead of creating a new user-defined class for the purpose.
| Field Summary | |
|---|---|
protected int |
hashCode
The hashCode. |
protected Object |
keyAsObject
The key as an Object. |
protected static I18NHelper |
msg
The Internationalization message helper. |
| Constructor Summary | |
|---|---|
|
SingleFieldIdentity()
Constructor only for Externalizable. |
protected |
SingleFieldIdentity(Class pcClass)
Constructor with target class. |
| Method Summary | |
|---|---|
protected void |
assertKeyNotNull(Object key)
Assert that the key is not null. |
protected int |
compare(SingleFieldIdentity o)
Determine the ordering of identity objects. |
protected Object |
createKeyAsObject()
Create the key as an Object. |
boolean |
equals(Object obj)
Check the class and class name and object type. |
Object |
getKeyAsObject()
Return the key as an Object. |
Class |
getTargetClass()
Return the target class. |
String |
getTargetClassName()
Return the target class name. |
protected int |
hashClassName()
Return the hash code of the class name. |
int |
hashCode()
Return the cached hash code. |
void |
readExternal(ObjectInput in)
Read from the input stream. |
protected void |
setKeyAsObject(Object key)
Set the given key as the key for this instance. |
void |
writeExternal(ObjectOutput out)
Write to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
protected static I18NHelper msg
protected int hashCode
protected Object keyAsObject
| Constructor Detail |
|---|
protected SingleFieldIdentity(Class pcClass)
pcClass - the class of the targetpublic SingleFieldIdentity()
| Method Detail |
|---|
protected void setKeyAsObject(Object key)
protected void assertKeyNotNull(Object key)
public Class getTargetClass()
public String getTargetClassName()
public Object getKeyAsObject()
protected Object createKeyAsObject()
public boolean equals(Object obj)
equals in class Objectobj - the other object
protected int hashClassName()
public int hashCode()
hashCode in class Object
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - the stream
IOException
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundExceptionprotected int compare(SingleFieldIdentity o)
o - Other identity
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||