I'm new to EJB 2.0; I can't figure out if there is a way to build dynamic EJB-QL queries (eg. run-time, not compile-time). All I've seen so far is EJB-QL queries in deployment descriptors.
I would like to have a query-by-form functionality in my application, but see no way to dynamically constuct an EJB-QL query.
As far as I know, it's not possible.
It is not part of the spec but Weblogic 7.0 does allow this,
I've found something similar in the latest JBoss release. Let's just hope this feature will make it into the new version of the spec as soon as possible.
If you take a look at the EJB 2.1 final draft:
Appendix A: Features deferred to future releases
- further extensions to EJB-QL, e.g. subqueries, multi-valued results, dynamic queries
I have always found it interesting about how many vendor extensions to the specification people use.
IMHO in the case of EJB-QL due to its limited nature at the moment vendor extensions seem necessary to make it useful,