Class PersistenceFieldElement
- java.lang.Object
-
- com.sun.jdo.api.persistence.model.jdo.PersistenceElement
-
- com.sun.jdo.api.persistence.model.jdo.PersistenceMemberElement
-
- com.sun.jdo.api.persistence.model.jdo.PersistenceFieldElement
-
- All Implemented Interfaces:
PersistenceElementProperties,Comparable
- Direct Known Subclasses:
RelationshipElement
public class PersistenceFieldElement extends PersistenceMemberElement
- Version:
- %I%
- Author:
- raccah
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePersistenceFieldElement.ImplPluggable implementation of the storage of field element properties.
-
Field Summary
Fields Modifier and Type Field Description static intDERIVEDConstant representing a derived field modifier.static intPERSISTENTConstant representing a persistent field modifier.static intTRANSIENTConstant representing a transient field modifier.-
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElementProperties
PROP_CARDINALITY, PROP_COLLECTION_CLASS, PROP_DELETE_ACTION, PROP_ELEMENT_CLASS, PROP_FIELDS, PROP_GROUPS, PROP_IDENTITY, PROP_INVERSE_FIELD, PROP_KEY_CLASS, PROP_KEY_FIELD, PROP_MODIFIED, PROP_NAME, PROP_PERSISTENCE, PROP_PREFETCH, PROP_SENSITIVITY, PROP_UPDATE_ACTION
-
-
Constructor Summary
Constructors Constructor Description PersistenceFieldElement()Create new PersistenceFieldElement with no implementation.PersistenceFieldElement(PersistenceFieldElement.Impl impl, PersistenceClassElement declaringClass)Create new PersistenceFieldElement with the provided implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConcurrencyGroupElement[]getConcurrencyGroups()Returns the array of concurrency groups to which this field belongs.intgetFieldNumber()Computes the field number of this field element.intgetPersistenceType()Get the persistence type of this field element.booleanisKey()Determines whether this field element is a key field or not.booleanisReadSensitive()Determines whether this field element is read sensitive or not.booleanisWriteSensitive()Determines whether this field element is write sensitive or not.voidsetKey(boolean flag)Set whether this field element is a key field or not.voidsetPersistenceType(int type)Set the persistence type of this field element.voidsetReadSensitive(boolean flag)Set whether this field element is read sensitive or not.voidsetWriteSensitive(boolean flag)Set whether this field element is write sensitive or not.-
Methods inherited from class com.sun.jdo.api.persistence.model.jdo.PersistenceMemberElement
equals, getDeclaringClass, hashCode, setDeclaringClass
-
Methods inherited from class com.sun.jdo.api.persistence.model.jdo.PersistenceElement
addPropertyChangeListener, addVetoableChangeListener, compareTo, getImpl, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setImpl, setName, toString
-
-
-
-
Field Detail
-
PERSISTENT
public static final int PERSISTENT
Constant representing a persistent field modifier.- See Also:
- Constant Field Values
-
DERIVED
public static final int DERIVED
Constant representing a derived field modifier.- See Also:
- Constant Field Values
-
TRANSIENT
public static final int TRANSIENT
Constant representing a transient field modifier. This constant is only here for comparison purposes, it will not be returned bygetPersistenceTypesince there will be no instance of this class for transient fields.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PersistenceFieldElement
public PersistenceFieldElement()
Create new PersistenceFieldElement with no implementation. This constructor should only be used for cloning and archiving.
-
PersistenceFieldElement
public PersistenceFieldElement(PersistenceFieldElement.Impl impl, PersistenceClassElement declaringClass)
Create new PersistenceFieldElement with the provided implementation. The implementation is responsible for storing all properties of the object.- Parameters:
impl- the implementation to usedeclaringClass- the class to attach to
-
-
Method Detail
-
getPersistenceType
public int getPersistenceType()
Get the persistence type of this field element.- Returns:
- the persistence type, one of
PERSISTENTorDERIVED
-
setPersistenceType
public void setPersistenceType(int type) throws ModelExceptionSet the persistence type of this field element.- Parameters:
type- - an integer indicating the persistence type, one of:PERSISTENTorDERIVED- Throws:
ModelException- if impossible
-
isReadSensitive
public boolean isReadSensitive()
Determines whether this field element is read sensitive or not. This value is only used ifgetPersistenceTypereturnsDERIVED- Returns:
trueif the field is read sensitive,falseif it is not or if the persistence type is not derived- See Also:
isWriteSensitive(),setPersistenceType(int),DERIVED
-
setReadSensitive
public void setReadSensitive(boolean flag) throws ModelExceptionSet whether this field element is read sensitive or not.- Parameters:
flag- - iftrueand this is a derived field, the field element is marked as read sensitive; otherwise, it is not This value is only used ifgetPersistenceTypereturnsDERIVED- Throws:
ModelException- if impossible- See Also:
setWriteSensitive(boolean),setPersistenceType(int),DERIVED
-
isWriteSensitive
public boolean isWriteSensitive()
Determines whether this field element is write sensitive or not. This value is only used ifgetPersistenceTypereturnsDERIVED- Returns:
trueif the field is write sensitive,falseif it is not or if the persistence type is not derived- See Also:
isReadSensitive(),setPersistenceType(int),DERIVED
-
setWriteSensitive
public void setWriteSensitive(boolean flag) throws ModelExceptionSet whether this field element is write sensitive or not.- Parameters:
flag- - iftrueand this is a derived field, the field element is marked as write sensitive; otherwise, it is not This value is only used ifgetPersistenceTypereturnsDERIVED- Throws:
ModelException- if impossible- See Also:
setReadSensitive(boolean),setPersistenceType(int),DERIVED
-
isKey
public boolean isKey()
Determines whether this field element is a key field or not.- Returns:
trueif the field is a key field,falseotherwise- See Also:
PersistenceClassElement.getKeyClass()
-
setKey
public void setKey(boolean flag) throws ModelExceptionSet whether this field element is a key field or not.- Parameters:
flag- - iftrue, the field element is marked as a key field; otherwise, it is not- Throws:
ModelException- if impossible- See Also:
PersistenceClassElement.getKeyClass()
-
getConcurrencyGroups
public ConcurrencyGroupElement[] getConcurrencyGroups()
Returns the array of concurrency groups to which this field belongs.- Returns:
- the concurrency groups in which this field participates
- See Also:
PersistenceClassElement.getConcurrencyGroups()
-
getFieldNumber
public int getFieldNumber()
Computes the field number of this field element.- Returns:
- the field number of this field, -1 if it cannot be found
-
-