DATACMNS-867 - Second draft.
This commit is contained in:
@@ -60,7 +60,7 @@ final class AnnotationAuditingMetadata {
|
||||
|
||||
static {
|
||||
|
||||
List<String> types = new ArrayList<String>(5);
|
||||
List<String> types = new ArrayList<>(5);
|
||||
types.add("org.joda.time.DateTime");
|
||||
types.add("org.joda.time.LocalDateTime");
|
||||
types.add(Date.class.getName());
|
||||
|
||||
@@ -73,17 +73,16 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
|
||||
}
|
||||
|
||||
Class<?> type = it.getClass();
|
||||
PersistentEntity<?, ?> entity = entities.getPersistentEntity(type);
|
||||
|
||||
if (entity == null) {
|
||||
return super.getBeanWrapperFor(source);
|
||||
}
|
||||
return entities.getPersistentEntity(type).map(entity -> {
|
||||
|
||||
MappingAuditingMetadata metadata = metadataCache.computeIfAbsent(type,
|
||||
foo -> new MappingAuditingMetadata(entity));
|
||||
MappingAuditingMetadata metadata = metadataCache.computeIfAbsent(type,
|
||||
key -> new MappingAuditingMetadata(entity));
|
||||
|
||||
return Optional.ofNullable(metadata.isAuditable()
|
||||
? new MappingMetadataAuditableBeanWrapper(entity.getPropertyAccessor(it), metadata) : null);
|
||||
return Optional.<AuditableBeanWrapper>ofNullable(metadata.isAuditable()
|
||||
? new MappingMetadataAuditableBeanWrapper(entity.getPropertyAccessor(it), metadata) : null);
|
||||
|
||||
}).orElseGet(() -> super.getBeanWrapperFor(source));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user