}
protected void buildAdminPresentationToOneLookupOverride(Map<String, FieldMetadata> mergedProperties, Map<String, AdminPresentationToOneLookupOverride> presentationOverrides, String propertyName, String key) {
AdminPresentationToOneLookupOverride override = presentationOverrides.get(propertyName);
if (override != null) {
AdminPresentationToOneLookup annot = override.value();
if (annot != null) {
if (!(mergedProperties.get(key) instanceof BasicFieldMetadata)) {
return;
}
BasicFieldMetadata metadata = (BasicFieldMetadata) mergedProperties.get(key);
metadata.setFieldType(SupportedFieldType.ADDITIONAL_FOREIGN_KEY);
metadata.setExplicitFieldType(SupportedFieldType.ADDITIONAL_FOREIGN_KEY);
metadata.setLookupDisplayProperty(annot.lookupDisplayProperty());
metadata.setForcePopulateChildProperties(annot.forcePopulateChildProperties());
metadata.setEnableTypeaheadLookup(annot.enableTypeaheadLookup());
if (!StringUtils.isEmpty(annot.lookupDisplayProperty())) {
metadata.setForeignKeyDisplayValueProperty(annot.lookupDisplayProperty());
}
metadata.setCustomCriteria(annot.customCriteria());
metadata.setUseServerSideInspectionCache(annot.useServerSideInspectionCache());
}
}
}