org.datanucleus.metadata
Class JoinMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.JoinMetaData
All Implemented Interfaces:
java.io.Serializable, ColumnMetaDataContainer

public class JoinMetaData
extends MetaData
implements ColumnMetaDataContainer

Secondary tables and join tables are mapped using a join condition that associates a column or columns in the secondary or join table with a column or columns in the primary table, typically the primary tables primary key columns. Column elements used for relationship mapping or join conditions specify the column name and optionally the target column name. The target column name is the name of the column in the associated table corresponding to the named column. The target column name is optional when the target column is the single primary key column of the associated table.

Since:
1.1
Version:
$Revision: 1.24 $
See Also:
Serialized Form

Field Summary
protected  ColumnMetaData[] columnMetaData
          Contains the metadata for column
protected  IndexedValue indexed
          The indexing value
protected  PrimaryKeyMetaData primaryKeyMetaData
          PrimaryKey MetaData
protected  boolean uniqueConstraint
          Whether to add a unique constraint.
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
JoinMetaData(MetaData parent, JoinMetaData joinmd)
          Constructor to create a copy of the passed JoinMetaData but with the passed parent.
JoinMetaData(MetaData parent, java.lang.String table, java.lang.String catalog, java.lang.String schema, java.lang.String columnName, java.lang.String outer, java.lang.String fkDeleteAction, java.lang.String indexed, java.lang.String unique)
          Constructor for the Join.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 java.lang.String getCatalog()
          Accessor for the catalog name
 ColumnMetaData[] getColumnMetaData()
          Accessor for columnMetaData
 java.lang.String getColumnName()
          Accessor for the column name
 ForeignKeyMetaData getForeignKeyMetaData()
           
 IndexMetaData getIndexMetaData()
           
 PrimaryKeyMetaData getPrimaryKeyMetaData()
          Accessor for primaryKeyMetaData
 java.lang.String getSchema()
          Accessor for the schema name
 java.lang.String getTable()
          Accessor for the table name
 UniqueMetaData getUniqueMetaData()
           
 void initialise()
          Method to initialise the object, creating internal convenience arrays.
 boolean isOuter()
           
 void setForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData)
           
 void setIndexMetaData(IndexMetaData indexMetaData)
           
 void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
          Mutator for the PrimaryKey MetaData.
 void setUniqueMetaData(UniqueMetaData uniqueMetaData)
           
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object using a prefix
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

primaryKeyMetaData

protected PrimaryKeyMetaData primaryKeyMetaData
PrimaryKey MetaData


indexed

protected IndexedValue indexed
The indexing value


uniqueConstraint

protected final boolean uniqueConstraint
Whether to add a unique constraint.


columnMetaData

protected ColumnMetaData[] columnMetaData
Contains the metadata for column

Constructor Detail

JoinMetaData

public JoinMetaData(MetaData parent,
                    JoinMetaData joinmd)
Constructor to create a copy of the passed JoinMetaData but with the passed parent.

Parameters:
parent - Parent
joinmd - Existing join metadata to copy

JoinMetaData

public JoinMetaData(MetaData parent,
                    java.lang.String table,
                    java.lang.String catalog,
                    java.lang.String schema,
                    java.lang.String columnName,
                    java.lang.String outer,
                    java.lang.String fkDeleteAction,
                    java.lang.String indexed,
                    java.lang.String unique)
Constructor for the Join.

Parameters:
parent - The parent
table - The table name
catalog - The catalog name
schema - The schema name
columnName - The column name
outer - Whether it is an outer join
fkDeleteAction - Delete action on the FK
indexed - whether the join is indexed
unique - whether the join is unique
Method Detail

initialise

public void initialise()
Method to initialise the object, creating internal convenience arrays. Initialises all sub-objects.

Overrides:
initialise in class MetaData

addColumn

public void addColumn(ColumnMetaData colmd)
Add a new ColumnMetaData element

Specified by:
addColumn in interface ColumnMetaDataContainer
Parameters:
colmd - The ColumnMetaData to add

getTable

public final java.lang.String getTable()
Accessor for the table name

Returns:
Returns the table name

getCatalog

public final java.lang.String getCatalog()
Accessor for the catalog name

Returns:
Returns the catalog name

getSchema

public final java.lang.String getSchema()
Accessor for the schema name

Returns:
Returns the schema name

getColumnName

public final java.lang.String getColumnName()
Accessor for the column name

Returns:
Returns the column.

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Accessor for columnMetaData

Specified by:
getColumnMetaData in interface ColumnMetaDataContainer
Returns:
Returns the columnMetaData.

isOuter

public final boolean isOuter()
Returns:
Returns the outer.

getIndexMetaData

public final IndexMetaData getIndexMetaData()
Returns:
Returns the indexMetaData.

getUniqueMetaData

public final UniqueMetaData getUniqueMetaData()
Returns:
Returns the uniquexMetaData.

getForeignKeyMetaData

public final ForeignKeyMetaData getForeignKeyMetaData()
Returns:
Returns the foreignKeyMetaData.

getPrimaryKeyMetaData

public final PrimaryKeyMetaData getPrimaryKeyMetaData()
Accessor for primaryKeyMetaData

Returns:
Returns the primaryKey MetaData.

setForeignKeyMetaData

public final void setForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData)
Parameters:
foreignKeyMetaData - The foreignKeyMetaData to set.

setIndexMetaData

public final void setIndexMetaData(IndexMetaData indexMetaData)
Parameters:
indexMetaData - The indexMetaData to set.

setUniqueMetaData

public final void setUniqueMetaData(UniqueMetaData uniqueMetaData)
Parameters:
uniqueMetaData - The uniqueMetaData to set.

setPrimaryKeyMetaData

public final void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
Mutator for the PrimaryKey MetaData.

Parameters:
primaryKeyMetaData - The PrimaryKey MetaData to set.

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object using a prefix

Overrides:
toString in class MetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © 2009. All Rights Reserved.