Replace occurrence filter in controller with boolean in named query