Muztaba Hasanat wrote:My question is, Using EntityManager is the only way to deal with criteria dynamic query or there are some cleaner way to do ?
It seems you are not the only one with
this concern. And here is
a SO question about the same topic. And in
this blog article you can find some pros of using the (more verbose) Criteria API. And there are also some other frameworks claiming to provide easier and less verbose criteria APIs, like
Querydsl.
Hope it helps!
Kind regards,
Roel