FileDocCategorySizeDatePackage
MetadataPrimaryKeyJoinColumn.javaAPI DocGlassfish v2 API4899Tue May 22 16:54:26 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns

MetadataPrimaryKeyJoinColumn

public class MetadataPrimaryKeyJoinColumn extends Object
Object to hold onto join column metadata in a TopLink database fields.
author
Guy Pelletier
since
TopLink EJB 3.0 Reference Implementation

Fields Summary
protected DatabaseField
m_pkField
protected DatabaseField
m_fkField
public static final String
DEFAULT_NAME
public static final String
DEFAULT_COLUMN_DEFINITION
public static final String
DEFAULT_REFERENCED_COLUMN_NAME
Constructors Summary
public MetadataPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn, String sourceTableName, String targetTableName)
INTERNAL: Called for association override.

    
              
           
        this(sourceTableName, targetTableName);
        
        if (primaryKeyJoinColumn != null) {
            // Process the primary key field metadata.
            m_pkField.setName(primaryKeyJoinColumn.referencedColumnName());
        
            // Process the foreign key field metadata.
            m_fkField.setName(primaryKeyJoinColumn.name());
            m_fkField.setColumnDefinition(primaryKeyJoinColumn.columnDefinition());
        }
    
public MetadataPrimaryKeyJoinColumn(String sourceTableName, String targetTableName)
INTERNAL:

        this(sourceTableName, targetTableName, DEFAULT_REFERENCED_COLUMN_NAME, DEFAULT_NAME);
    
public MetadataPrimaryKeyJoinColumn(String sourceTableName, String targetTableName, String defaultFieldName)
INTERNAL:

        this(sourceTableName, targetTableName, defaultFieldName, defaultFieldName);
    
protected MetadataPrimaryKeyJoinColumn(String sourceTableName, String targetTableName, String defaultPKFieldName, String defaultFKFieldName)
INTERNAL:

        m_pkField = new DatabaseField();
        m_pkField.setName(defaultPKFieldName);
        m_pkField.setTableName(sourceTableName);
        
        m_fkField = new DatabaseField();
        m_fkField.setName(defaultFKFieldName);
        m_fkField.setTableName(targetTableName);
        m_fkField.setColumnDefinition(DEFAULT_COLUMN_DEFINITION);
    
Methods Summary
public oracle.toplink.essentials.internal.helper.DatabaseFieldgetForeignKeyField()
INTERNAL:

        return m_fkField;
    
public oracle.toplink.essentials.internal.helper.DatabaseFieldgetPrimaryKeyField()
INTERNAL:

        return m_pkField;
    
public booleanisForeignKeyFieldNotSpecified()
INTERNAL:

        return m_fkField.getName().equals("");
    
public booleanisPrimaryKeyFieldNotSpecified()
INTERNAL:

        return m_pkField.getName().equals("");
    
public booleanloadedFromXML()
INTERNAL:

        return false;