* Process the embeddable class and gather up our 'original' collection of
* primary key fields. They are original because they may change with the
* specification of an attribute override.
*/
protected MetadataDescriptor processEmbeddableClass() {
MetadataDescriptor embeddableDescriptor = super.processEmbeddableClass();
// After processing the embeddable class, we need to gather our
// primary keys fields that we will eventually set on the owning
// descriptor metadata.
if (isEmbeddedId() && ! m_descriptor.ignoreIDs()) {
if (embeddableDescriptor.getMappings().isEmpty()) {
String accessType = embeddableDescriptor.usesPropertyAccess() ? AccessType.PROPERTY.name() : AccessType.FIELD.name();
m_validator.throwEmbeddedIdHasNoAttributes(m_descriptor.getJavaClass(), embeddableDescriptor.getJavaClass(), accessType);
}
for (DatabaseMapping mapping : embeddableDescriptor.getMappings()) {
DatabaseField field = (DatabaseField) mapping.getField().clone();
field.setTableName(m_descriptor.getPrimaryTableName());
m_idFields.put(mapping.getAttributeName(), field);
}
}