Search in sources :

Example 1 with AdjustFieldDefaultRelationsCommand

use of org.kie.workbench.common.screens.datamodeller.client.handlers.jpadomain.command.AdjustFieldDefaultRelationsCommand in project kie-wb-common by kiegroup.

the class JPADomainHandler method postCommandProcessing.

@Override
public void postCommandProcessing(DataModelCommand command) {
    if (command instanceof FieldTypeChangeCommand && (isPersistable(((FieldTypeChangeCommand) command).getDataObject()) || isRelationConfigured(((FieldTypeChangeCommand) command).getField()))) {
        AdjustFieldDefaultRelationsCommand postCommand = commandBuilder.buildAdjustFieldDefaultRelationsCommand((FieldTypeChangeCommand) command, getName(), ((FieldTypeChangeCommand) command).getField());
        postCommand.execute();
    } else if (command instanceof AddPropertyCommand && isPersistable(((AddPropertyCommand) command).getDataObject())) {
        AdjustFieldDefaultRelationsCommand postCommand = commandBuilder.buildAdjustFieldDefaultRelationsCommand((AddPropertyCommand) command, getName(), ((AddPropertyCommand) command).getProperty());
        postCommand.execute();
    }
}
Also used : AdjustFieldDefaultRelationsCommand(org.kie.workbench.common.screens.datamodeller.client.handlers.jpadomain.command.AdjustFieldDefaultRelationsCommand) FieldTypeChangeCommand(org.kie.workbench.common.screens.datamodeller.client.command.FieldTypeChangeCommand) AddPropertyCommand(org.kie.workbench.common.screens.datamodeller.client.command.AddPropertyCommand)

Aggregations

AddPropertyCommand (org.kie.workbench.common.screens.datamodeller.client.command.AddPropertyCommand)1 FieldTypeChangeCommand (org.kie.workbench.common.screens.datamodeller.client.command.FieldTypeChangeCommand)1 AdjustFieldDefaultRelationsCommand (org.kie.workbench.common.screens.datamodeller.client.handlers.jpadomain.command.AdjustFieldDefaultRelationsCommand)1