I don't want to be a pest, but could someone at least tell me if what I'm trying to do should work (hence I should try harder to understand what I've misconfigured), or if I should just give up and use my work around (separate queries for each subclass)?
I'm using JBoss AS 4.2.1.GA and Seam 2.0.0.CR1
Can EJBQL be used to query polymorphically? I cannot find any examples in the spec or in Bill Burke's EJB3 book, and my attempts are always returning null.
l = entityManager.createQuery("SELECT s FROM Security s").getResultList();
Here I'm trying to find all rows of all security subclasses. Even though the database has many such entries, the query always returns null. I can find each subclass independently - eg.:
this should work. I have done the same by declaring named queries on each of the bean classes.
you could take a look at this sample:
Unfortunately the language is german, but hope you can make your way through the code.
The application client calls finder methods to load
-all beans of all subtypes
-all beans of subtype a
-all beans of subtype b
Hope his helps
Thanks Wolfgang, that's very helpful!
I don't see anything obviously different in your code vs. mine, but knowing that this works for you, I'll now start getting serious about finding my error. I'll report back to the thread when I fix it.