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

MetadataJoinColumn

public class MetadataJoinColumn 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_TABLE
public static final String
DEFAULT_COLUMN_DEFINITION
public static final String
DEFAULT_REFERENCED_COLUMN_NAME
public static final boolean
DEFAULT_UNIQUE
public static final boolean
DEFAULT_NULLABLE
public static final boolean
DEFAULT_UPDATABLE
public static final boolean
DEFAULT_INSERTABLE
Constructors Summary
public MetadataJoinColumn()
INTERNAL:

    
          
      
        this(DEFAULT_REFERENCED_COLUMN_NAME, DEFAULT_NAME);
    
public MetadataJoinColumn(JoinColumn joinColumn)
INTERNAL: Called for association override.

        this();
        
        if (joinColumn != null) {
            // Process the primary key field metadata.
            m_pkField.setName(joinColumn.referencedColumnName());
        
            // Process the foreign key field metadata.
            m_fkField.setName(joinColumn.name());
            m_fkField.setTableName(joinColumn.table());
            m_fkField.setUnique(joinColumn.unique());
            m_fkField.setNullable(joinColumn.nullable());
            m_fkField.setUpdatable(joinColumn.updatable());
            m_fkField.setInsertable(joinColumn.insertable());
            m_fkField.setColumnDefinition(joinColumn.columnDefinition());
        }
    
public MetadataJoinColumn(String defaultName)
INTERNAL:

        this(defaultName, defaultName);
    
protected MetadataJoinColumn(String defaultReferenceColumnName, String defaultName)
INTERNAL:

        m_pkField = new DatabaseField();
        m_pkField.setName(defaultReferenceColumnName);
        
        m_fkField = new DatabaseField();
        m_fkField.setName(defaultName);
        m_fkField.setTableName(DEFAULT_TABLE);
        m_fkField.setUnique(DEFAULT_UNIQUE);
        m_fkField.setNullable(DEFAULT_NULLABLE);
        m_fkField.setUpdatable(DEFAULT_UPDATABLE);
        m_fkField.setInsertable(DEFAULT_INSERTABLE);
        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;