if (options.hasOwnProperty('where')) {
        options.where = this.getWhereConditions(options.where, tableName, factory, options)
        if (subQuery) {
          subQueryItems.push(" WHERE " + options.where)
        } else {