*/
@Override
public boolean onPreInsert(PreInsertEvent event) {
if (isMultiTenantEntity(event.getEntity())) {
if (!currentTenant.isSet()) {
throw new NoCurrentTenantException("Tried to save multi-tenant domain class '"
+ event.getEntity().getClass().getSimpleName() + "', but no tenant is set");
}
Integer currentTenantId = currentTenant.get();
hibernateEventPropertyUpdater.updateProperty(event, MultiTenantAST.TENANT_ID_FIELD_NAME, currentTenantId);