// Process/validate the attribute name first if there is one.
if (hasAttributeName()) {
// If the mapping is an aggregate object mapping, validate the
// attribute name existing on the embeddable and update the reference class.
if (mapping.isAggregateObjectMapping()) {
ClassAccessor embeddableAccessor = getProject().getEmbeddableAccessor(referenceClass);
MappingAccessor mappingAccessor = embeddableAccessor.getDescriptor().getMappingAccessor(getAttributeName());
if (mappingAccessor == null) {
throw ValidationException.embeddableAttributeNameForConvertNotFound(accessor.getJavaClassName(), mapping.getAttributeName(), embeddableAccessor.getJavaClassName(), getAttributeName());
}
referenceClass = mappingAccessor.getReferenceClass();
} else {
throw ValidationException.invalidMappingForConvertWithAttributeName(accessor.getJavaClassName(), mapping.getAttributeName());