use of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyForeignKeyMetadata in project eclipselink by eclipse-ee4j.
the class EntityImpl method setPrimaryKeyForeignKey.
@Override
public ForeignKey setPrimaryKeyForeignKey() {
ForeignKeyImpl foreignKey = new ForeignKeyImpl();
getMetadata().setPrimaryKeyForeignKey(new PrimaryKeyForeignKeyMetadata(foreignKey.getMetadata()));
return foreignKey;
}
use of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyForeignKeyMetadata in project eclipselink by eclipse-ee4j.
the class EntityAccessor method processInheritancePrimaryKeyJoinColumns.
/**
* INTERNAL:
* Process the inheritance metadata for an inheritance subclass. The
* parent descriptor must be provided.
*/
public void processInheritancePrimaryKeyJoinColumns() {
// some defined through annotations.
if (m_primaryKeyJoinColumns.isEmpty()) {
// Process all the primary key join columns first.
if (isAnnotationPresent(JPA_PRIMARY_KEY_JOIN_COLUMNS)) {
MetadataAnnotation primaryKeyJoinColumns = getAnnotation(JPA_PRIMARY_KEY_JOIN_COLUMNS);
for (Object primaryKeyJoinColumn : primaryKeyJoinColumns.getAttributeArray("value")) {
m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata((MetadataAnnotation) primaryKeyJoinColumn, this));
}
// Set the primary key foreign key metadata if one is specified.
if (primaryKeyJoinColumns.hasAttribute("foreignKey")) {
setPrimaryKeyForeignKey(new PrimaryKeyForeignKeyMetadata(primaryKeyJoinColumns.getAttributeAnnotation("foreignKey"), this));
}
}
// Process the single primary key join column second.
if (isAnnotationPresent(JPA_PRIMARY_KEY_JOIN_COLUMN)) {
PrimaryKeyJoinColumnMetadata primaryKeyJoinColumn = new PrimaryKeyJoinColumnMetadata(getAnnotation(JPA_PRIMARY_KEY_JOIN_COLUMN), this);
m_primaryKeyJoinColumns.add(primaryKeyJoinColumn);
// Set the primary key foreign key metadata if specified.
if (primaryKeyJoinColumn.hasForeignKey()) {
setPrimaryKeyForeignKey(new PrimaryKeyForeignKeyMetadata(primaryKeyJoinColumn.getForeignKey()));
}
}
}
// Process the primary key join columns into multiple table key fields.
addMultipleTableKeyFields(m_primaryKeyJoinColumns, getDescriptor().getPrimaryTable(), MetadataLogger.INHERITANCE_PK_COLUMN, MetadataLogger.INHERITANCE_FK_COLUMN);
// Process the primary key foreign key.
if (m_primaryKeyForeignKey != null) {
m_primaryKeyForeignKey.process(getDescriptor().getPrimaryTable());
}
}
use of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyForeignKeyMetadata in project eclipselink by eclipse-ee4j.
the class SecondaryTableImpl method setPrimaryKeyForeignKey.
@Override
public ForeignKey setPrimaryKeyForeignKey() {
ForeignKeyImpl foreignKey = new ForeignKeyImpl();
getMetadata().setPrimaryKeyForeignKey(new PrimaryKeyForeignKeyMetadata(foreignKey.getMetadata()));
return foreignKey;
}
use of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyForeignKeyMetadata in project eclipselink by eclipse-ee4j.
the class OneToOneImpl method setPrimaryKeyForeignKey.
@Override
public ForeignKey setPrimaryKeyForeignKey() {
ForeignKeyImpl foreignKey = new ForeignKeyImpl();
getMetadata().setPrimaryKeyForeignKey(new PrimaryKeyForeignKeyMetadata(foreignKey.getMetadata()));
return foreignKey;
}
Aggregations