Class MappingFieldElementImpl
- java.lang.Object
-
- com.sun.jdo.api.persistence.model.mapping.impl.MappingElementImpl
-
- com.sun.jdo.api.persistence.model.mapping.impl.MappingMemberElementImpl
-
- com.sun.jdo.api.persistence.model.mapping.impl.MappingFieldElementImpl
-
- All Implemented Interfaces:
MappingElement,MappingElementProperties,MappingFieldElement,MappingMemberElement,Comparable
- Direct Known Subclasses:
MappingRelationshipElementImpl
public class MappingFieldElementImpl extends MappingMemberElementImpl implements MappingFieldElement
- Version:
- %I%
- Author:
- Mark Munro, Rochelle Raccah
-
-
Field Summary
Fields Modifier and Type Field Description static intCLONE_DEEPstatic intCLONE_FIELDstatic intCLONE_MASKstatic intIN_CONCURRENCY_CHECKstatic intLOG_ON_ACCESSstatic intLOG_ON_MASKstatic intLOG_ON_UPDATEstatic intMOD_BI_ON_UPDATEstatic intOBSERVE_ON_ACCESSstatic intREAD_ONLYstatic intRECORD_ON_UPDATEstatic intREF_INTEGRITY_UPDATESstatic intSEND_BEFORE_IMAGEstatic intXLATE_FIELD-
Fields inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElementProperties
PROP_ASSOCIATED_COLUMNS, PROP_COLUMNS, PROP_CONSISTENCY, PROP_DATABASE_ROOT, PROP_FETCH_GROUP, PROP_FIELDS, PROP_IN_CONCURRENCY_CHECK, PROP_KEY_COLUMNS, PROP_MODIFIED, PROP_NAME, PROP_NAVIGABLE, PROP_READ_ONLY, PROP_REFERENCING_KEYS, PROP_TABLE, PROP_TABLES, PROP_VERSION_FIELD
-
Fields inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingFieldElement
GROUP_DEFAULT, GROUP_INDEPENDENT, GROUP_NONE
-
-
Constructor Summary
Constructors Constructor Description MappingFieldElementImpl()Create new MappingFieldElementImpl with no corresponding name or declaring class.MappingFieldElementImpl(String name, MappingClassElement declaringClass)Create new MappingFieldElementImpl with the corresponding name and declaring class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(org.netbeans.modules.dbschema.DBMemberElement column)Adds a column to the list of columns mapped by this mapping field.intgetCloneDepth()ArrayListgetColumnObjects()Returns the list of columns (ColumnElements) to which this mapping field is mapped.ArrayListgetColumns()Returns the list of column names to which this mapping field is mapped.ConcurrencyGroupElement[]getConcurrencyGroups()Returns the array of concurrency groups to which this field belongs.intgetFetchGroup()Get the fetch group of this field element.intgetFieldNumber()Computes the field number of this field element.booleangetLogOnAccess()booleangetLogOnUpdate()booleangetModifyBeforeImageOnUpdate()booleangetObserveOnAccess()intgetProperties()booleangetRecordOnUpdate()booleangetReferentialIntegrityUpdates()booleangetSendBeforeImage()booleanisInConcurrencyCheck()Determines whether this field element is in a concurrency check or not.protected booleanisMappedToTable(MappingTableElement table)booleanisReadOnly()Determines whether this field element is read only or not.booleanisVersion()Determines whether this field element is a version field or not.voidremoveColumn(String columnName)Removes a column from the list of columns mapped by this mapping field.voidsetCloneDepth(int cloneDepth)voidsetFetchGroup(int group)Set the fetch group of this field element.protected voidsetFetchGroupInternal(int group)Set the fetch group of this field element.voidsetInConcurrencyCheck(boolean flag)Set whether this field element is in a concurrency check or not.voidsetLogOnAccess(boolean flag)voidsetLogOnUpdate(boolean flag)voidsetModifyBeforeImageOnUpdate(boolean flag)voidsetObserveOnAccess(boolean flag)voidsetProperty(boolean flag, int propertyBit)voidsetReadOnly(boolean flag)Set whether this field element is read only or not.voidsetRecordOnUpdate(boolean flag)voidsetReferentialIntegrityUpdates(boolean flag)voidsetSendBeforeImage(boolean flag)voidsetVersion(boolean flag)Set whether this field element is a version field or not.protected voidstripSchemaName()Boston to Pilsen conversion.-
Methods inherited from class com.sun.jdo.api.persistence.model.mapping.impl.MappingMemberElementImpl
equals, firePropertyChange, fireVetoableChange, getDeclaringClass, hashCode, setDeclaringClass
-
Methods inherited from class com.sun.jdo.api.persistence.model.mapping.impl.MappingElementImpl
addPropertyChangeListener, addVetoableChangeListener, compareTo, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setName, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElement
addPropertyChangeListener, addVetoableChangeListener, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
-
Methods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingMemberElement
getDeclaringClass
-
-
-
-
Field Detail
-
CLONE_FIELD
public static final int CLONE_FIELD
- See Also:
- Constant Field Values
-
CLONE_DEEP
public static final int CLONE_DEEP
- See Also:
- Constant Field Values
-
CLONE_MASK
public static final int CLONE_MASK
- See Also:
- Constant Field Values
-
LOG_ON_ACCESS
public static final int LOG_ON_ACCESS
- See Also:
- Constant Field Values
-
LOG_ON_MASK
public static final int LOG_ON_MASK
- See Also:
- Constant Field Values
-
LOG_ON_UPDATE
public static final int LOG_ON_UPDATE
- See Also:
- Constant Field Values
-
MOD_BI_ON_UPDATE
public static final int MOD_BI_ON_UPDATE
- See Also:
- Constant Field Values
-
OBSERVE_ON_ACCESS
public static final int OBSERVE_ON_ACCESS
- See Also:
- Constant Field Values
-
RECORD_ON_UPDATE
public static final int RECORD_ON_UPDATE
- See Also:
- Constant Field Values
-
SEND_BEFORE_IMAGE
public static final int SEND_BEFORE_IMAGE
- See Also:
- Constant Field Values
-
READ_ONLY
public static final int READ_ONLY
- See Also:
- Constant Field Values
-
REF_INTEGRITY_UPDATES
public static final int REF_INTEGRITY_UPDATES
- See Also:
- Constant Field Values
-
IN_CONCURRENCY_CHECK
public static final int IN_CONCURRENCY_CHECK
- See Also:
- Constant Field Values
-
XLATE_FIELD
public static final int XLATE_FIELD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MappingFieldElementImpl
public MappingFieldElementImpl()
Create new MappingFieldElementImpl with no corresponding name or declaring class. This constructor should only be used for cloning and archiving.
-
MappingFieldElementImpl
public MappingFieldElementImpl(String name, MappingClassElement declaringClass)
Create new MappingFieldElementImpl with the corresponding name and declaring class.- Parameters:
name- the name of the elementdeclaringClass- the class to attach to
-
-
Method Detail
-
isReadOnly
public boolean isReadOnly()
Determines whether this field element is read only or not.- Specified by:
isReadOnlyin interfaceMappingFieldElement- Returns:
trueif the field is read only,falseotherwise
-
setReadOnly
public void setReadOnly(boolean flag) throws ModelExceptionSet whether this field element is read only or not.- Specified by:
setReadOnlyin interfaceMappingFieldElement- Parameters:
flag- - iftrue, the field element is marked as read only; otherwise, it is not- Throws:
ModelException- if impossible
-
isInConcurrencyCheck
public boolean isInConcurrencyCheck()
Determines whether this field element is in a concurrency check or not.- Specified by:
isInConcurrencyCheckin interfaceMappingFieldElement- Returns:
trueif the field is in a concurrency check,falseotherwise
-
setInConcurrencyCheck
public void setInConcurrencyCheck(boolean flag) throws ModelExceptionSet whether this field element is in a concurrency check or not.- Specified by:
setInConcurrencyCheckin interfaceMappingFieldElement- Parameters:
flag- - iftrue, the field element is marked as being in a concurrency check; otherwise, it is not- Throws:
ModelException- if impossible
-
isVersion
public boolean isVersion()
Determines whether this field element is a version field or not.- Specified by:
isVersionin interfaceMappingFieldElement- Returns:
trueif the field is a version field,falseotherwise
-
setVersion
public void setVersion(boolean flag) throws ModelExceptionSet whether this field element is a version field or not.- Specified by:
setVersionin interfaceMappingFieldElement- Parameters:
flag- - iftrue, the field element is marked as a version field; otherwise, it is not- Throws:
ModelException- if impossible
-
getFetchGroup
public int getFetchGroup()
Get the fetch group of this field element.- Specified by:
getFetchGroupin interfaceMappingFieldElement- Returns:
- the fetch group, one of
MappingFieldElement.GROUP_DEFAULT,MappingFieldElement.GROUP_NONE, or anything less than or equal toMappingFieldElement.GROUP_INDEPENDENT
-
setFetchGroup
public void setFetchGroup(int group) throws ModelExceptionSet the fetch group of this field element.- Specified by:
setFetchGroupin interfaceMappingFieldElement- Parameters:
group- - an integer indicating the fetch group, one of:MappingFieldElement.GROUP_DEFAULT,MappingFieldElement.GROUP_NONE, or anything less than or equal toMappingFieldElement.GROUP_INDEPENDENT- Throws:
ModelException- if impossible
-
setFetchGroupInternal
protected void setFetchGroupInternal(int group)
Set the fetch group of this field element. Meant to be used in the constructor and by subclasses when there should be no exceptions and no property change events fired.- Parameters:
group- - an integer indicating the fetch group, one of:MappingFieldElement.GROUP_DEFAULT,MappingFieldElement.GROUP_NONE, or anything less than or equal toMappingFieldElement.GROUP_INDEPENDENT
-
getColumns
public ArrayList getColumns()
Returns the list of column names to which this mapping field is mapped.- Specified by:
getColumnsin interfaceMappingFieldElement- Returns:
- the names of the columns mapped by this mapping field
-
addColumn
public void addColumn(org.netbeans.modules.dbschema.DBMemberElement column) throws ModelExceptionAdds a column to the list of columns mapped by this mapping field.- Specified by:
addColumnin interfaceMappingFieldElement- Parameters:
column- column element to be added to the mapping- Throws:
ModelException- if impossible
-
removeColumn
public void removeColumn(String columnName) throws ModelException
Removes a column from the list of columns mapped by this mapping field. This method overrides the one in MappingFieldElement to remove the argument from the associated columns if necessary.- Specified by:
removeColumnin interfaceMappingFieldElement- Parameters:
columnName- the relative name of the column to be removed from the mapping- Throws:
ModelException- if impossible
-
isMappedToTable
protected boolean isMappedToTable(MappingTableElement table)
-
getColumnObjects
public ArrayList getColumnObjects()
Returns the list of columns (ColumnElements) to which this mapping field is mapped. This method should only be used by the runtime.- Returns:
- the columns mapped by this mapping field
-
getFieldNumber
public int getFieldNumber()
Computes the field number of this field element.- Returns:
- the field number of this field
-
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()
-
setProperty
public void setProperty(boolean flag, int propertyBit)
-
getProperties
public int getProperties()
-
getLogOnAccess
public boolean getLogOnAccess()
-
setLogOnAccess
public void setLogOnAccess(boolean flag)
-
getLogOnUpdate
public boolean getLogOnUpdate()
-
setLogOnUpdate
public void setLogOnUpdate(boolean flag)
-
getObserveOnAccess
public boolean getObserveOnAccess()
-
setObserveOnAccess
public void setObserveOnAccess(boolean flag)
-
getRecordOnUpdate
public boolean getRecordOnUpdate()
-
setRecordOnUpdate
public void setRecordOnUpdate(boolean flag)
-
getModifyBeforeImageOnUpdate
public boolean getModifyBeforeImageOnUpdate()
-
setModifyBeforeImageOnUpdate
public void setModifyBeforeImageOnUpdate(boolean flag)
-
getReferentialIntegrityUpdates
public boolean getReferentialIntegrityUpdates()
-
setReferentialIntegrityUpdates
public void setReferentialIntegrityUpdates(boolean flag)
-
getSendBeforeImage
public boolean getSendBeforeImage()
-
setSendBeforeImage
public void setSendBeforeImage(boolean flag)
-
getCloneDepth
public int getCloneDepth()
-
setCloneDepth
public void setCloneDepth(int cloneDepth)
-
stripSchemaName
protected void stripSchemaName()
Boston to Pilsen conversion. This method converts the absolute column names to relative names.
-
-