use of org.kie.workbench.common.screens.datamodeller.client.command.ValuePair in project kie-wb-common by kiegroup.
the class JPADataObjectEditor method onAuditedFieldChange.
@Override
public void onAuditedFieldChange(String newValue) {
if (getDataObject() != null) {
Boolean doAdd = Boolean.parseBoolean(newValue);
DataModelCommand command;
if (doAdd) {
List<ValuePair> defaultValues = new ArrayList<>();
defaultValues.add(new ValuePair("targetAuditMode", "NOT_AUDITED"));
command = commandBuilder.buildDataObjectAddAnnotationCommand(getContext(), getName(), getDataObject(), JPADomainAnnotations.HIBERNATE_ENVERS_AUDITED, defaultValues);
} else {
command = commandBuilder.buildDataObjectRemoveAnnotationCommand(getContext(), getName(), getDataObject(), JPADomainAnnotations.HIBERNATE_ENVERS_AUDITED);
}
command.execute();
}
}
Aggregations