Search in sources :

Example 1 with Cascade

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;
}
Also used : ArrayList(java.util.ArrayList) SettingDto(org.motechproject.mds.dto.SettingDto) Cascade(org.motechproject.mds.annotations.Cascade)

Aggregations

ArrayList (java.util.ArrayList)1 Cascade (org.motechproject.mds.annotations.Cascade)1 SettingDto (org.motechproject.mds.dto.SettingDto)1