if (modelEntity == null) {
throw new GenericModelException("Could not find ModelEntity record for entityName: " + entity.getEntityName());
}
SQLProcessor sqlP = new SQLProcessor(helperName);
try {
return singleInsert(entity, modelEntity, modelEntity.getFieldsCopy(), sqlP);
} catch (GenericEntityException e) {
sqlP.rollback();
throw new GenericEntityException("Exception while inserting the following entity: " + entity.toString(), e);
} finally {
sqlP.close();
}
}