Class MappingRelationshipElementImpl
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
com.sun.jdo.api.persistence.model.mapping.impl.MappingRelationshipElementImpl
- All Implemented Interfaces:
MappingElement,MappingElementProperties,MappingFieldElement,MappingMemberElement,MappingRelationshipElement,Comparable
public class MappingRelationshipElementImpl
extends MappingFieldElementImpl
implements MappingRelationshipElement
- Version:
- %I%
- Author:
- Mark Munro, Rochelle Raccah
-
Field Summary
Fields inherited from class com.sun.jdo.api.persistence.model.mapping.impl.MappingFieldElementImpl
CLONE_DEEP, CLONE_FIELD, CLONE_MASK, IN_CONCURRENCY_CHECK, LOG_ON_ACCESS, LOG_ON_MASK, LOG_ON_UPDATE, MOD_BI_ON_UPDATE, OBSERVE_ON_ACCESS, READ_ONLY, RECORD_ON_UPDATE, REF_INTEGRITY_UPDATES, SEND_BEFORE_IMAGE, XLATE_FIELDFields 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_FIELDFields inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingFieldElement
GROUP_DEFAULT, GROUP_INDEPENDENT, GROUP_NONE -
Constructor Summary
ConstructorsConstructorDescriptionCreate new MappingRelationshipElementImpl with no corresponding name or declaring class.MappingRelationshipElementImpl(String name, MappingClassElement declaringClass) Create new MappingRelationshipElementImpl with the corresponding name and declaring class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAssociatedColumn(org.netbeans.modules.dbschema.ColumnPairElement column) Adds a column to the list of associated columns mapped by this mapping field.voidaddColumn(org.netbeans.modules.dbschema.DBMemberElement column) Adds a column to the list of columns mapped by this mapping relationship.voidaddLocalColumn(org.netbeans.modules.dbschema.ColumnPairElement column) Adds a column to the list of columns mapped by this mapping field.Returns the list of associated columns (ColumnPairElements) to which this mapping field is mapped.Returns the list of associated column names to which this mapping field is mapped.intGet the delete action for this relationship element.Get the element class for this relationship element.intGet the lower cardinality bound for this relationship element.intGet the update action for this relationship element.intGet the upper cardinality bound for this relationship element.voidremoveColumn(String columnName) Removes a column from the list of columns mapped by this mapping field.voidsetAssociatedColumns(ArrayList associatedColumns) Set the list of associated column names to which this mapping field is mapped.protected voidBoston to Pilsen conversion.Methods inherited from class com.sun.jdo.api.persistence.model.mapping.impl.MappingFieldElementImpl
getCloneDepth, getColumnObjects, getColumns, getConcurrencyGroups, getFetchGroup, getFieldNumber, getLogOnAccess, getLogOnUpdate, getModifyBeforeImageOnUpdate, getObserveOnAccess, getProperties, getRecordOnUpdate, getReferentialIntegrityUpdates, getSendBeforeImage, isInConcurrencyCheck, isMappedToTable, isReadOnly, isVersion, setCloneDepth, setFetchGroup, setFetchGroupInternal, setInConcurrencyCheck, setLogOnAccess, setLogOnUpdate, setModifyBeforeImageOnUpdate, setObserveOnAccess, setProperty, setReadOnly, setRecordOnUpdate, setReferentialIntegrityUpdates, setSendBeforeImage, setVersionMethods inherited from class com.sun.jdo.api.persistence.model.mapping.impl.MappingMemberElementImpl
equals, firePropertyChange, fireVetoableChange, getDeclaringClass, hashCode, setDeclaringClassMethods inherited from class com.sun.jdo.api.persistence.model.mapping.impl.MappingElementImpl
addPropertyChangeListener, addVetoableChangeListener, compareTo, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setName, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElement
addPropertyChangeListener, addVetoableChangeListener, getName, removePropertyChangeListener, removeVetoableChangeListener, setNameMethods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingFieldElement
getColumns, getFetchGroup, isInConcurrencyCheck, isReadOnly, isVersion, setFetchGroup, setInConcurrencyCheck, setReadOnly, setVersionMethods inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingMemberElement
getDeclaringClass
-
Constructor Details
-
MappingRelationshipElementImpl
public MappingRelationshipElementImpl()Create new MappingRelationshipElementImpl with no corresponding name or declaring class. This constructor should only be used for cloning and archiving. -
MappingRelationshipElementImpl
Create new MappingRelationshipElementImpl with the corresponding name and declaring class.- Parameters:
name- the name of the elementdeclaringClass- the class to attach to
-
-
Method Details
-
getAssociatedColumns
Returns the list of associated column names to which this mapping field is mapped. This is used for join tables.- Specified by:
getAssociatedColumnsin interfaceMappingRelationshipElement- Returns:
- the names of the columns mapped by this mapping field
- See Also:
-
addLocalColumn
public void addLocalColumn(org.netbeans.modules.dbschema.ColumnPairElement column) throws ModelException Adds a column to the list of columns mapped by this mapping field. Call this method instead ofaddColumnwhen mapping join tables. This method is used to map between the local column and the join table, whileaddAssociatedColumnis used to map between the join table and the foreign table.- Specified by:
addLocalColumnin interfaceMappingRelationshipElement- Parameters:
column- column pair element to be added to the mapping- Throws:
ModelException- if impossible- See Also:
-
addAssociatedColumn
public void addAssociatedColumn(org.netbeans.modules.dbschema.ColumnPairElement column) throws ModelException Adds a column to the list of associated columns mapped by this mapping field. Call this method instead ofaddColumnwhen mapping join tables. This method is used to map between the join table column and the foreign table column, whileaddLocalColumnis used to map between the local table and the join table.- Specified by:
addAssociatedColumnin interfaceMappingRelationshipElement- Parameters:
column- column pair element to be added to the mapping- Throws:
ModelException- if impossible- See Also:
-
addColumn
Adds a column to the list of columns mapped by this mapping relationship. This method overrides the one in MappingFieldElement to check that the argument is a ColumnPairElement.- Specified by:
addColumnin interfaceMappingFieldElement- Overrides:
addColumnin classMappingFieldElementImpl- Parameters:
column- column element to be added to the mapping- Throws:
ModelException- if impossible
-
removeColumn
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- Overrides:
removeColumnin classMappingFieldElementImpl- Parameters:
columnName- the relative name of the column to be removed from the mapping- Throws:
ModelException- if impossible
-
getAssociatedColumnObjects
Returns the list of associated columns (ColumnPairElements) to which this mapping field is mapped. This is used for join tables. This method should only be used by the runtime.- Returns:
- the columns mapped by this mapping field
- See Also:
-
getElementClass
Get the element class for this relationship element. If primitive types are supported, you can usewrapperclass.TYPEto specify them.- Returns:
- the element class
-
getUpdateAction
public int getUpdateAction()Get the update action for this relationship element.- Returns:
- the update action, one of
RelationshipElement.NONE_ACTION,RelationshipElement.NULLIFY_ACTION,RelationshipElement.RESTRICT_ACTION,RelationshipElement.CASCADE_ACTION, orRelationshipElement.AGGREGATE_ACTION
-
getDeleteAction
public int getDeleteAction()Get the delete action for this relationship element.- Returns:
- the delete action, one of
RelationshipElement.NONE_ACTION,RelationshipElement.NULLIFY_ACTION,RelationshipElement.RESTRICT_ACTION,RelationshipElement.CASCADE_ACTION, orRelationshipElement.AGGREGATE_ACTION
-
getUpperBound
public int getUpperBound()Get the upper cardinality bound for this relationship element. ReturnsInteger.MAX_VALUEforn- Returns:
- the upper cardinality bound
-
getLowerBound
public int getLowerBound()Get the lower cardinality bound for this relationship element.- Returns:
- the lower cardinality bound
-
setAssociatedColumns
Set the list of associated column names to which this mapping field is mapped. This method should only be used internally and for cloning and archiving.- Parameters:
associatedColumns- the list of names of the columns mapped by this mapping field
-
stripSchemaName
protected void stripSchemaName()Boston to Pilsen conversion. This method converts the absolute column names to relative names.- Overrides:
stripSchemaNamein classMappingFieldElementImpl
-