use of org.motechproject.mds.annotations.Cascade in project motech by motech.
the class FieldProcessor method createRelationshipSettings.
private List<SettingDto> createRelationshipSettings(AccessibleObject ac) {
Cascade cascade = ReflectionsUtil.getAnnotationSelfOrAccessor(ac, Cascade.class);
boolean persist = parseBoolean(getAnnotationValue(cascade, PERSIST, TRUE.toString()));
boolean update = parseBoolean(getAnnotationValue(cascade, UPDATE, TRUE.toString()));
boolean delete = parseBoolean(getAnnotationValue(cascade, DELETE, FALSE.toString()));
List<SettingDto> list = new ArrayList<>();
list.add(new SettingDto(Constants.Settings.CASCADE_PERSIST, persist));
list.add(new SettingDto(Constants.Settings.CASCADE_UPDATE, update));
list.add(new SettingDto(Constants.Settings.CASCADE_DELETE, delete));
return list;
}
Aggregations