public class MappingReferenceKeyElementImpl extends MappingMemberElementImpl implements MappingReferenceKeyElement
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
Constructor and Description |
---|
MappingReferenceKeyElementImpl()
Create new MappingReferenceKeyElementImpl with no corresponding name.
|
MappingReferenceKeyElementImpl(MappingTableElement table)
Creates new MappingReferenceKeyElementImpl with a corresponding
mapping table.
|
MappingReferenceKeyElementImpl(String name)
Creates new MappingReferenceKeyElementImpl with the corresponding name
|
Modifier and Type | Method and Description |
---|---|
void |
addColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair)
Add a new column pair to the holder.
|
void |
addColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
Add some new column pairs to the holder.
|
org.netbeans.modules.dbschema.ColumnPairElement |
getColumnPair(org.netbeans.modules.dbschema.DBIdentifier name)
Find a column pair by name.
|
ArrayList |
getColumnPairNames()
Returns the list of relative column pair names in this referencing key.
|
org.netbeans.modules.dbschema.ColumnPairElement[] |
getColumnPairs()
Get all column pairs in this holder.
|
org.netbeans.modules.dbschema.TableElement |
getDeclaringTable()
Get the declaring table.
|
String |
getKeyName()
Get the name of this element.
|
org.netbeans.modules.dbschema.ColumnElement[] |
getLocalColumns()
Get all local columns in this reference key.
|
org.netbeans.modules.dbschema.ColumnElement[] |
getReferencedColumns()
Get all referenced columns in this reference key.
|
org.netbeans.modules.dbschema.TableElement |
getReferencedTable()
Get the referenced table of the reference key.
|
MappingTableElement |
getTable()
Returns the mapping table element for this referencing key.
|
void |
removeColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair)
Remove a column pair from the holder.
|
void |
removeColumnPair(String pairName)
Remove a column pair from the holder.
|
void |
removeColumnPairs(ArrayList pairNames)
Remove some column pairs from the holder.
|
void |
removeColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
Remove some column pairs from the holder.
|
void |
setColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs)
Set the column pairs for this holder.
|
void |
setDeclaringTable(org.netbeans.modules.dbschema.TableElement tableElement)
Set the mapping table for this referencing key to the mapping table
based on the name of the supplied table.
|
void |
setKeyName(String name)
Set the name of this element.
|
void |
setReferencingKey(ArrayList referencingKey)
Set the list of of key column names in this referencing key.
|
void |
setTable(MappingTableElement table)
Set the mapping table for this referencing key to the supplied table.
|
protected void |
stripSchemaName()
Boston to Pilsen conversion.
|
equals, firePropertyChange, fireVetoableChange, getDeclaringClass, hashCode, setDeclaringClass
addPropertyChangeListener, addVetoableChangeListener, compareTo, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setName, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDeclaringClass
addPropertyChangeListener, addVetoableChangeListener, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
compareTo
public MappingReferenceKeyElementImpl()
public MappingReferenceKeyElementImpl(String name)
name
- the name of the elementpublic MappingReferenceKeyElementImpl(MappingTableElement table) throws ModelException
table
- mapping table element to be used with this key.ModelException
public String getKeyName()
getKeyName
in interface org.netbeans.modules.dbschema.ReferenceKey
public void setKeyName(String name) throws ModelException
setKeyName
in interface org.netbeans.modules.dbschema.ReferenceKey
name
- the nameModelException
- if impossiblepublic MappingTableElement getTable()
getTable
in interface MappingReferenceKeyElement
public void setTable(MappingTableElement table) throws ModelException
setTable
in interface MappingReferenceKeyElement
table
- mapping table element to be used with this key.ModelException
- if impossiblepublic org.netbeans.modules.dbschema.TableElement getDeclaringTable()
getDeclaringTable
in interface org.netbeans.modules.dbschema.ReferenceKey
null
if the element is not attached to any tablepublic void setDeclaringTable(org.netbeans.modules.dbschema.TableElement tableElement)
setDeclaringTable
in interface org.netbeans.modules.dbschema.ReferenceKey
tableElement
- mapping table element to be used with this key.public org.netbeans.modules.dbschema.TableElement getReferencedTable()
getReferencedTable
in interface org.netbeans.modules.dbschema.ReferenceKey
public ArrayList getColumnPairNames()
getColumnPairNames
in interface MappingReferenceKeyElement
public org.netbeans.modules.dbschema.ColumnElement[] getLocalColumns()
getLocalColumns
in interface org.netbeans.modules.dbschema.ReferenceKey
public org.netbeans.modules.dbschema.ColumnElement[] getReferencedColumns()
getReferencedColumns
in interface org.netbeans.modules.dbschema.ReferenceKey
public void removeColumnPair(String pairName) throws ModelException
removeColumnPair
in interface MappingReferenceKeyElement
pairName
- the relative name of the column pair to removeModelException
- if impossiblepublic void removeColumnPairs(ArrayList pairNames) throws ModelException
removeColumnPairs
in interface MappingReferenceKeyElement
pairNames
- the relative names of the column pairs to removeModelException
- if impossiblepublic void addColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair) throws ModelException
addColumnPair
in interface MappingReferenceKeyElement
addColumnPair
in interface org.netbeans.modules.dbschema.ColumnPairElementHolder
pair
- the pair to addModelException
- if impossiblepublic void addColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs) throws ModelException
addColumnPairs
in interface MappingReferenceKeyElement
addColumnPairs
in interface org.netbeans.modules.dbschema.ColumnPairElementHolder
pairs
- the column pairs to addModelException
- if impossiblepublic void removeColumnPair(org.netbeans.modules.dbschema.ColumnPairElement pair) throws ModelException
removeColumnPair
in interface MappingReferenceKeyElement
removeColumnPair
in interface org.netbeans.modules.dbschema.ColumnPairElementHolder
pair
- the column pair to removeModelException
- if impossiblepublic void removeColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs) throws ModelException
removeColumnPairs
in interface MappingReferenceKeyElement
removeColumnPairs
in interface org.netbeans.modules.dbschema.ColumnPairElementHolder
pairs
- the column pairs to removeModelException
- if impossiblepublic void setColumnPairs(org.netbeans.modules.dbschema.ColumnPairElement[] pairs) throws ModelException
setColumnPairs
in interface MappingReferenceKeyElement
setColumnPairs
in interface org.netbeans.modules.dbschema.ColumnPairElementHolder
pairs
- the new column pairsModelException
- if impossiblepublic org.netbeans.modules.dbschema.ColumnPairElement[] getColumnPairs()
getColumnPairs
in interface org.netbeans.modules.dbschema.ColumnPairElementHolder
public org.netbeans.modules.dbschema.ColumnPairElement getColumnPair(org.netbeans.modules.dbschema.DBIdentifier name)
getColumnPair
in interface org.netbeans.modules.dbschema.ColumnPairElementHolder
name
- the name of the column pair for which to looknull
if not foundpublic void setReferencingKey(ArrayList referencingKey)
referencingKey
- the list of names of the columns in this
referencing keyprotected void stripSchemaName()
Copyright © 2019. All rights reserved.