Ugly WHERE clause hack for getAll()