public void insert(CassandraPersistenceSession session, EventSubscriptionEntity entity) {
    session.addStatement(createUpdateStatement(session, entity));

    for (IndexHandler<EventSubscriptionEntity> index : indexHandlers.values()) {
      session.addStatement(index.getInsertStatement(session, entity));
    }
  }
  public void delete(CassandraPersistenceSession session, EventSubscriptionEntity entity) {
    session.addStatement(
        QueryBuilder.delete()
            .mapElt("event_subscriptions", entity.getId())
            .from(ProcessInstanceTableHandler.TABLE_NAME)
            .where(eq("id", entity.getProcessInstanceId())),
        entity.getProcessInstanceId());

    for (IndexHandler<EventSubscriptionEntity> index : indexHandlers.values()) {
      session.addIndexStatement(
          index.getDeleteStatement(session, entity), entity.getProcessInstanceId());
    }
  }