// notation names meaning you will not find their respective mapping
// accessor on the embeddable descriptor.
Map<String, AttributeOverrideMetadata> mergedAttributeOverrides = getAttributeOverrides(attributeOverrides);
for (String attributeName : mergedAttributeOverrides.keySet()) {
AttributeOverrideMetadata attributeOverride = mergedAttributeOverrides.get(attributeName);
// The getMappingForAttributeName call will take care of any sub dot
// notation attribute names when looking for the mapping. It will
// traverse the embeddable chain.
MappingAccessor mappingAccessor = embeddableDescriptor.getMappingAccessor(attributeName);
if (mappingAccessor == null) {
throw ValidationException.embeddableAttributeOverrideNotFound(embeddableDescriptor.getJavaClass(), attributeName, getJavaClass(), getAttributeName());
} else if (! mappingAccessor.isBasic()) {
throw ValidationException.invalidEmbeddableAttributeForAttributeOverride(embeddableDescriptor.getJavaClass(), attributeName, getJavaClass(), getAttributeName());
} else {
boolean useDelimitedIdentifier = (embeddableDescriptor.getProject() != null) ? embeddableDescriptor.getProject().useDelimitedIdentifier() : false;
DatabaseField overrideField = attributeOverride.getColumn().getDatabaseField();
if (useDelimitedIdentifier){
overrideField.setUseDelimiters(useDelimitedIdentifier);
} else if (embeddableDescriptor.getProject().getShouldForceFieldNamesToUpperCase() && !overrideField.shouldUseDelimiters()) {
overrideField.useUpperCaseForComparisons(true);
}