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
- Version:
- %I%
- Author:
- raccah
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePluggable implementation of the storage of field element properties. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant representing a derived field modifier.static final intConstant representing a persistent field modifier.static final intConstant 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
ConstructorsConstructorDescriptionCreate new PersistenceFieldElement with no implementation.PersistenceFieldElement(PersistenceFieldElement.Impl impl, PersistenceClassElement declaringClass) Create new PersistenceFieldElement with the provided implementation. -
Method Summary
Modifier and TypeMethodDescriptionReturns the array of concurrency groups to which this field belongs.intComputes the field number of this field element.intGet the persistence type of this field element.booleanisKey()Determines whether this field element is a key field or not.booleanDetermines whether this field element is read sensitive or not.booleanDetermines 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, setDeclaringClassMethods inherited from class com.sun.jdo.api.persistence.model.jdo.PersistenceElement
addPropertyChangeListener, addVetoableChangeListener, compareTo, getImpl, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setImpl, setName, toString
-
Field Details
-
PERSISTENT
public static final int PERSISTENTConstant representing a persistent field modifier.- See Also:
-
DERIVED
public static final int DERIVEDConstant representing a derived field modifier.- See Also:
-
TRANSIENT
public static final int TRANSIENTConstant 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:
-
-
Constructor Details
-
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 Details
-
getPersistenceType
public int getPersistenceType()Get the persistence type of this field element.- Returns:
- the persistence type, one of
PERSISTENTorDERIVED
-
setPersistenceType
Set 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:
-
setReadSensitive
Set 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:
-
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:
-
setWriteSensitive
Set 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:
-
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:
-
setKey
Set 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:
-
getConcurrencyGroups
Returns the array of concurrency groups to which this field belongs.- Returns:
- the concurrency groups in which this field participates
- See Also:
-
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
-