MetadataPrimaryKeyJoinColumnspublic class MetadataPrimaryKeyJoinColumns extends Object Object to hold onto join column metadata. |
Fields Summary |
---|
private String | m_sourceTableName | private String | m_targetTableName | protected List | m_pkJoinColumns |
Constructors Summary |
---|
public MetadataPrimaryKeyJoinColumns(String sourceTableName, String targetTableName)INTERNAL:
m_sourceTableName = sourceTableName;
m_targetTableName = targetTableName;
m_pkJoinColumns = new ArrayList<MetadataPrimaryKeyJoinColumn>();
| public MetadataPrimaryKeyJoinColumns(PrimaryKeyJoinColumn[] primaryKeyJoinColumns, String sourceTableName, String targetTableName)INTERNAL:
this(sourceTableName, targetTableName);
// Process the primary key join column array.
for (PrimaryKeyJoinColumn pkJoinColumn : primaryKeyJoinColumns) {
m_pkJoinColumns.add(new MetadataPrimaryKeyJoinColumn(pkJoinColumn, sourceTableName, targetTableName));
}
| public MetadataPrimaryKeyJoinColumns(PrimaryKeyJoinColumns primaryKeyJoinColumns, PrimaryKeyJoinColumn primaryKeyJoinColumn, String sourceTableName, String targetTableName)INTERNAL:
this(sourceTableName, targetTableName);
// Process all the primary key join columns first.
if (primaryKeyJoinColumns != null) {
for (PrimaryKeyJoinColumn pkJoinColumn : primaryKeyJoinColumns.value()) {
m_pkJoinColumns.add(new MetadataPrimaryKeyJoinColumn(pkJoinColumn, sourceTableName, targetTableName));
}
}
// Process the single primary key join column second.
if (primaryKeyJoinColumn != null) {
m_pkJoinColumns.add(new MetadataPrimaryKeyJoinColumn(primaryKeyJoinColumn, sourceTableName, targetTableName));
}
|
Methods Summary |
---|
public boolean | loadedFromXML()INTERNAL:
return false;
| public java.util.List | values(oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor descriptor)INTERNAL:
This method is called when it is time to process the primary key join
columns. So if the user didn't specify any, then we need to default
accordingly.
// If no primary key join columns are specified ...
if (m_pkJoinColumns.isEmpty()) {
if (descriptor.hasCompositePrimaryKey()) {
// Add a default one for each part of the composite primary
// key. Foreign and primary key to have the same name.
for (String primaryKeyField : descriptor.getPrimaryKeyFieldNames()) {
m_pkJoinColumns.add(new MetadataPrimaryKeyJoinColumn(m_sourceTableName, m_targetTableName, primaryKeyField));
}
} else {
// Add a default one for the single case, not setting any
// foreign and primary key names. They will default based
// on which accessor is using them.
m_pkJoinColumns.add(new MetadataPrimaryKeyJoinColumn(m_sourceTableName, m_targetTableName));
}
}
return m_pkJoinColumns;
|
|