// 3 processing. Accessors are added to different lists since
// the order or processing of those accessors is important.
// See MetadataProject.processStage2() for more details.
// Care must be taken in the order of checking here.
if (accessor.isDirectEmbeddableCollection() || accessor.isEmbedded()) {
EmbeddableAccessor embeddableAccessor = getProject().getEmbeddableAccessor(accessor.getReferenceClass());
// If there is no embeddable accessor at this point,
// something is wrong, throw an exception. Note a direct
// embeddable collection can't hit here since we don't build
// a direct embeddable collection if the reference class is
// not an Embeddable.
if (embeddableAccessor == null) {
throw ValidationException.invalidEmbeddedAttribute(getJavaClass(), accessor.getAttributeName(), accessor.getReferenceClass());
} else {
// Process the embeddable class now.
embeddableAccessor.process(owningDescriptor);
// Store this descriptor metadata. It may be needed again
// later on to look up a mappedBy attribute etc.
addEmbeddableDescriptor(embeddableAccessor.getDescriptor());
// Since association overrides are not allowed on
// embeddedid's we can and must process it right now,
// instead of deferring it till after the relationship
// accessors have processed.