org.jpox.metadata
Class JoinMetaData

java.lang.Object
  extended byorg.jpox.metadata.MetaData
      extended byorg.jpox.metadata.ExtendableMetaData
          extended byorg.jpox.metadata.JoinMetaData
All Implemented Interfaces:
ColumnMetaDataContainer, java.io.Serializable

public class JoinMetaData
extends ExtendableMetaData
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.

MetaData Element

The MetaData element represented here is as follows
 
 
 
 
 
 
 
 
 

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

Field Summary
protected  ColumnMetaData[] columnMetaData
          Contains the metadata for column
protected  PrimaryKeyMetaData primaryKeyMetaData
          PrimaryKey MetaData
 
Fields inherited from class org.jpox.metadata.ExtendableMetaData
extensions, JPOX_VENDOR_NAME
 
Fields inherited from class org.jpox.metadata.MetaData
LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent
 
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 column, java.lang.String outer, java.lang.String foreignKey)
          Constructor for the Join.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 java.lang.String getColumn()
          Accessor for the column name
 ColumnMetaData[] getColumnMetaData()
          Accessor for columnMetaData
 java.lang.String getForeignKey()
           
 ForeignKeyMetaData getForeignKeyMetaData()
           
 IndexMetaData getIndexMetaData()
           
 PrimaryKeyMetaData getPrimaryKeyMetaData()
          Accessor for primaryKeyMetaData
 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()
          Accessor for a string representation of the object.
 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.jpox.metadata.ExtendableMetaData
addExtension, addExtension, getExtension, getExtensions, getNoOfExtensions, getValueForExtension, getValuesForExtension, getValuesForExtensionStartingWith, hasExtension, removeExtension
 
Methods inherited from class org.jpox.metadata.MetaData
getParent, isCreated, isInitialised, isPopulated, isUsed, populate, setInitialised, setPopulated, setUsed
 
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


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 column,
                    java.lang.String outer,
                    java.lang.String foreignKey)
Constructor for the Join.

Parameters:
parent - The parent
table - The table name
column - The column name
outer - Whether it is an outer join
foreignKey -
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

getColumn

public final java.lang.String getColumn()
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.

getForeignKey

public final java.lang.String getForeignKey()
Returns:
Returns the foreignKey.

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()
Accessor for a string representation of the object.

Overrides:
toString in class ExtendableMetaData
Returns:
a string representation of the object.

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 ExtendableMetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © -2007 . All Rights Reserved.