Specification.where(forView(view)).and(search(q)).and(category(c)) A null specification is simply skipped.