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 int
CLONE_DEEP
static int
CLONE_FIELD
static int
CLONE_MASK
static int
IN_CONCURRENCY_CHECK
static int
LOG_ON_ACCESS
static int
LOG_ON_MASK
static int
LOG_ON_UPDATE
static int
MOD_BI_ON_UPDATE
static int
OBSERVE_ON_ACCESS
static int
READ_ONLY
static int
RECORD_ON_UPDATE
static int
REF_INTEGRITY_UPDATES
static int
SEND_BEFORE_IMAGE
static int
XLATE_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 void
addColumn(org.netbeans.modules.dbschema.DBMemberElement column)
Adds a column to the list of columns mapped by this mapping field.int
getCloneDepth()
ArrayList
getColumnObjects()
Returns the list of columns (ColumnElements) to which this mapping field is mapped.ArrayList
getColumns()
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.int
getFetchGroup()
Get the fetch group of this field element.int
getFieldNumber()
Computes the field number of this field element.boolean
getLogOnAccess()
boolean
getLogOnUpdate()
boolean
getModifyBeforeImageOnUpdate()
boolean
getObserveOnAccess()
int
getProperties()
boolean
getRecordOnUpdate()
boolean
getReferentialIntegrityUpdates()
boolean
getSendBeforeImage()
boolean
isInConcurrencyCheck()
Determines whether this field element is in a concurrency check or not.protected boolean
isMappedToTable(MappingTableElement table)
boolean
isReadOnly()
Determines whether this field element is read only or not.boolean
isVersion()
Determines whether this field element is a version field or not.void
removeColumn(String columnName)
Removes a column from the list of columns mapped by this mapping field.void
setCloneDepth(int cloneDepth)
void
setFetchGroup(int group)
Set the fetch group of this field element.protected void
setFetchGroupInternal(int group)
Set the fetch group of this field element.void
setInConcurrencyCheck(boolean flag)
Set whether this field element is in a concurrency check or not.void
setLogOnAccess(boolean flag)
void
setLogOnUpdate(boolean flag)
void
setModifyBeforeImageOnUpdate(boolean flag)
void
setObserveOnAccess(boolean flag)
void
setProperty(boolean flag, int propertyBit)
void
setReadOnly(boolean flag)
Set whether this field element is read only or not.void
setRecordOnUpdate(boolean flag)
void
setReferentialIntegrityUpdates(boolean flag)
void
setSendBeforeImage(boolean flag)
void
setVersion(boolean flag)
Set whether this field element is a version field or not.protected void
stripSchemaName()
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:
isReadOnly
in interfaceMappingFieldElement
- Returns:
true
if the field is read only,false
otherwise
-
setReadOnly
public void setReadOnly(boolean flag) throws ModelException
Set whether this field element is read only or not.- Specified by:
setReadOnly
in 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:
isInConcurrencyCheck
in interfaceMappingFieldElement
- Returns:
true
if the field is in a concurrency check,false
otherwise
-
setInConcurrencyCheck
public void setInConcurrencyCheck(boolean flag) throws ModelException
Set whether this field element is in a concurrency check or not.- Specified by:
setInConcurrencyCheck
in 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:
isVersion
in interfaceMappingFieldElement
- Returns:
true
if the field is a version field,false
otherwise
-
setVersion
public void setVersion(boolean flag) throws ModelException
Set whether this field element is a version field or not.- Specified by:
setVersion
in 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:
getFetchGroup
in 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 ModelException
Set the fetch group of this field element.- Specified by:
setFetchGroup
in 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:
getColumns
in interfaceMappingFieldElement
- Returns:
- the names of the columns mapped by this mapping field
-
addColumn
public void addColumn(org.netbeans.modules.dbschema.DBMemberElement column) throws ModelException
Adds a column to the list of columns mapped by this mapping field.- Specified by:
addColumn
in 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:
removeColumn
in 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.
-
-