use of org.springframework.roo.classpath.scanner.MemberDetails in project spring-roo by spring-projects.
the class PersistenceMemberLocatorImpl method populateEmbeddedIdFields.
private void populateEmbeddedIdFields(final MemberDetails details, final JavaType type) {
final List<FieldMetadata> embeddedIdFields = MemberFindingUtils.getFieldsWithTag(details, CustomDataKeys.EMBEDDED_ID_FIELD);
if (!embeddedIdFields.isEmpty()) {
domainTypeEmbeddedIdFieldsCache.remove(type);
domainTypeEmbeddedIdFieldsCache.put(type, new ArrayList<FieldMetadata>());
final MemberDetails memberDetails = getMemberDetails(embeddedIdFields.get(0).getFieldType());
if (memberDetails != null) {
for (final FieldMetadata field : memberDetails.getFields()) {
if (!field.getCustomData().keySet().contains(CustomDataKeys.SERIAL_VERSION_UUID_FIELD)) {
domainTypeEmbeddedIdFieldsCache.get(type).add(field);
}
}
}
} else if (domainTypeEmbeddedIdFieldsCache.containsKey(type)) {
domainTypeEmbeddedIdFieldsCache.remove(type);
}
}
Aggregations