XX-11133 - changed sql to command to java on delete event.unit tests added by Laurentiu, thanks!