com.sun.jdo.api.persistence.model.jdo.impl
Class PersistenceFieldElementImpl

java.lang.Object
  extended by com.sun.jdo.api.persistence.model.jdo.impl.PersistenceElementImpl
      extended by com.sun.jdo.api.persistence.model.jdo.impl.PersistenceMemberElementImpl
          extended by com.sun.jdo.api.persistence.model.jdo.impl.PersistenceFieldElementImpl
All Implemented Interfaces:
PersistenceElement.Impl, PersistenceElementProperties, PersistenceFieldElement.Impl, PersistenceMemberElement.Impl
Direct Known Subclasses:
RelationshipElementImpl

public class PersistenceFieldElementImpl
extends PersistenceMemberElementImpl
implements PersistenceFieldElement.Impl

Version:
%I%
Author:
raccah

Field Summary
 
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
ADD, REMOVE, SET
 
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
PersistenceFieldElementImpl()
          Create new PersistenceFieldElementImpl with no corresponding name.
PersistenceFieldElementImpl(String name)
          Creates new PersistenceFieldElementImpl with the corresponding name
 
Method Summary
 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.
 
Methods inherited from class com.sun.jdo.api.persistence.model.jdo.impl.PersistenceMemberElementImpl
firePropertyChange, fireVetoableChange
 
Methods inherited from class com.sun.jdo.api.persistence.model.jdo.impl.PersistenceElementImpl
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
 

Constructor Detail

PersistenceFieldElementImpl

public PersistenceFieldElementImpl()
Create new PersistenceFieldElementImpl with no corresponding name. This constructor should only be used for cloning and archiving.


PersistenceFieldElementImpl

public PersistenceFieldElementImpl(String name)
Creates new PersistenceFieldElementImpl with the corresponding name

Parameters:
name - the name of the element
Method Detail

getPersistenceType

public int getPersistenceType()
Get the persistence type of this field element.

Specified by:
getPersistenceType in interface PersistenceFieldElement.Impl
Returns:
the persistence type, one of PersistenceFieldElement.PERSISTENT or PersistenceFieldElement.DERIVED. The default is PERSISTENT.

setPersistenceType

public void setPersistenceType(int type)
                        throws ModelException
Set the persistence type of this field element.

Specified by:
setPersistenceType in interface PersistenceFieldElement.Impl
Parameters:
type - - an integer indicating the persistence type, one of: PersistenceFieldElement.PERSISTENT or PersistenceFieldElement.DERIVED
Throws:
ModelException - if impossible

isReadSensitive

public boolean isReadSensitive()
Determines whether this field element is read sensitive or not. This value is only used if getPersistenceType returns DERIVED

Specified by:
isReadSensitive in interface PersistenceFieldElement.Impl
Returns:
true if the field is read sensitive, false if it is not or if the persistence type is not derived
See Also:
isWriteSensitive(), setPersistenceType(int), PersistenceFieldElement.DERIVED

setReadSensitive

public void setReadSensitive(boolean flag)
                      throws ModelException
Set whether this field element is read sensitive or not.

Specified by:
setReadSensitive in interface PersistenceFieldElement.Impl
Parameters:
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
Throws:
ModelException - if impossible
See Also:
setWriteSensitive(boolean), setPersistenceType(int), PersistenceFieldElement.DERIVED

isWriteSensitive

public boolean isWriteSensitive()
Determines whether this field element is write sensitive or not. This value is only used if getPersistenceType returns DERIVED

Specified by:
isWriteSensitive in interface PersistenceFieldElement.Impl
Returns:
true if the field is write sensitive, false if it is not or if the persistence type is not derived
See Also:
isReadSensitive(), setPersistenceType(int), PersistenceFieldElement.DERIVED

setWriteSensitive

public void setWriteSensitive(boolean flag)
                       throws ModelException
Set whether this field element is write sensitive or not.

Specified by:
setWriteSensitive in interface PersistenceFieldElement.Impl
Parameters:
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
Throws:
ModelException - if impossible
See Also:
setReadSensitive(boolean), setPersistenceType(int), PersistenceFieldElement.DERIVED

isKey

public boolean isKey()
Determines whether this field element is a key field or not.

Specified by:
isKey in interface PersistenceFieldElement.Impl
Returns:
true if the field is a key field, false otherwise
See Also:
PersistenceClassElementImpl.getKeyClass()

setKey

public void setKey(boolean flag)
            throws ModelException
Set whether this field element is a key field or not.

Specified by:
setKey in interface PersistenceFieldElement.Impl
Parameters:
flag - - if true, the field element is marked as a key field; otherwise, it is not
Throws:
ModelException - if impossible
See Also:
PersistenceClassElementImpl.getKeyClass()


Copyright © 2012 GlassFish Community. All Rights Reserved.