creating EJB-QL queries at runtime

A

Ads

We need to be able to create specific EJB-QL queries at runtime to find a
set of EJBs. All we need to be able to do is enter some SQL or EJB-QL and
for the container to return a collection of objects, or primarykeys. Is this
possible?
If not, is there a way to get details of the database the container is
using? (We are using jBoss with mysql, but we need a non-container specific
solution), so that we can just run out own SQL queries on that. Not ideal,
but we need to be able to search all the EJBs fast and our search criteria
changes too much to have specific searchs in the deployment descriptor.

Cheers

Ads
 
S

Sudsy

Ads said:
We need to be able to create specific EJB-QL queries at runtime to find a
set of EJBs.

Not possible as EJB-QL queries are defined before the EJBs go into
production.
All we need to be able to do is enter some SQL or EJB-QL and
for the container to return a collection of objects, or primarykeys. Is this
possible?

Not the responsibility of the container.
If not, is there a way to get details of the database the container is
using? (We are using jBoss with mysql, but we need a non-container specific
solution), so that we can just run out own SQL queries on that. Not ideal,
but we need to be able to search all the EJBs fast and our search criteria
changes too much to have specific searchs in the deployment descriptor.

I believe that you need to rethink what it is that you're trying to
achieve. You could write some code which uses java.sql.DatabaseMetaData
to determine the contents of a particular database. I don't know of any
introspection or reflection methods available to tell you which entity
beans are associated with those tables, especially since some could be
utilizing joins.
Perhaps if you were to clarify your goals?
The use of certain terms in your query is quite confusing, vis a vis
general understanding...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top