public class PersistenceFieldElement extends PersistenceMemberElement
Modifier and Type | Class and Description |
---|---|
static interface |
PersistenceFieldElement.Impl
Pluggable implementation of the storage of field element properties.
|
Modifier and Type | Field and Description |
---|---|
static int |
DERIVED
Constant representing a derived field modifier.
|
static int |
PERSISTENT
Constant representing a persistent field modifier.
|
static int |
TRANSIENT
Constant representing a transient field modifier.
|
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 and Description |
---|
PersistenceFieldElement()
Create new PersistenceFieldElement with no implementation.
|
PersistenceFieldElement(PersistenceFieldElement.Impl impl,
PersistenceClassElement declaringClass)
Create new PersistenceFieldElement with the provided implementation.
|
Modifier and Type | Method and Description |
---|---|
ConcurrencyGroupElement[] |
getConcurrencyGroups()
Returns the array of concurrency groups to which this field belongs.
|
int |
getFieldNumber()
Computes the field number of this field element.
|
int |
getPersistenceType()
Get the persistence type of this field element.
|
boolean |
isKey()
Determines whether this field element is a key field or not.
|
boolean |
isReadSensitive()
Determines whether this field element is read sensitive or not.
|
boolean |
isWriteSensitive()
Determines whether this field element is write sensitive or not.
|
void |
setKey(boolean flag)
Set whether this field element is a key field or not.
|
void |
setPersistenceType(int type)
Set the persistence type of this field element.
|
void |
setReadSensitive(boolean flag)
Set whether this field element is read sensitive or not.
|
void |
setWriteSensitive(boolean flag)
Set whether this field element is write sensitive or not.
|
equals, getDeclaringClass, hashCode, setDeclaringClass
addPropertyChangeListener, addVetoableChangeListener, compareTo, getImpl, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setImpl, setName, toString
public static final int PERSISTENT
public static final int DERIVED
public static final int TRANSIENT
getPersistenceType
since there will be no instance of
this class for transient fields.public PersistenceFieldElement()
public PersistenceFieldElement(PersistenceFieldElement.Impl impl, PersistenceClassElement declaringClass)
impl
- the implementation to usedeclaringClass
- the class to attach topublic int getPersistenceType()
PERSISTENT
or
DERIVED
public void setPersistenceType(int type) throws ModelException
type
- - an integer indicating the persistence type, one of:
PERSISTENT
or DERIVED
ModelException
- if impossiblepublic boolean isReadSensitive()
getPersistenceType
returns
DERIVED
true
if the field is read sensitive,
false
if it is not or if the persistence type is not derivedisWriteSensitive()
,
setPersistenceType(int)
,
DERIVED
public void setReadSensitive(boolean flag) throws ModelException
flag
- - if true
and this is a derived field, the field
element is marked as read sensitive; otherwise, it is not
This value is only used if getPersistenceType
returns
DERIVED
ModelException
- if impossiblesetWriteSensitive(boolean)
,
setPersistenceType(int)
,
DERIVED
public boolean isWriteSensitive()
getPersistenceType
returns
DERIVED
true
if the field is write sensitive,
false
if it is not or if the persistence type is not derivedisReadSensitive()
,
setPersistenceType(int)
,
DERIVED
public void setWriteSensitive(boolean flag) throws ModelException
flag
- - if true
and this is a derived field, the field
element is marked as write sensitive; otherwise, it is not
This value is only used if getPersistenceType
returns
DERIVED
ModelException
- if impossiblesetReadSensitive(boolean)
,
setPersistenceType(int)
,
DERIVED
public boolean isKey()
true
if the field is a key field,
false
otherwisePersistenceClassElement.getKeyClass()
public void setKey(boolean flag) throws ModelException
flag
- - if true
, the field element is marked
as a key field; otherwise, it is notModelException
- if impossiblePersistenceClassElement.getKeyClass()
public ConcurrencyGroupElement[] getConcurrencyGroups()
PersistenceClassElement.getConcurrencyGroups()
public int getFieldNumber()
Copyright © 2018. All rights reserved.