BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(src.getClass()).getBeanDescriptor();
for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
Class propertyType = propertyDescriptor.getType();
Object propertyValue = propertyDescriptor.getValue(src);
if (Entity.class.isAssignableFrom(propertyType)) {
Entity entity = (Entity) propertyValue;
if (EntityUtils.isNotEmptyId(entity)) {
if (!this.isCascade(propertyDescriptor)) {
Entity newEntity = (Entity) propertyType.newInstance();
newEntity.setId(entity.getId());
propertyDescriptor.setValue(src, newEntity);
eventSource.evict(entity);
}
} else {
propertyDescriptor.setValue(src, null);