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.:
l = entityManager.createQuery("SELECT s FROM SecurityLoan s").getResultList();
| l = entityManager.createQuery("SELECT s FROM SecurityEquity
s").getResultList();
but would like to write a single query to get all objects, regardless of subclass.
My entities are declared using JOINED inheritence:
| @Entity
| @Table(name = "security")
| @Inheritance(strategy = InheritanceType.JOINED)
| public class Security implements java.io.Serializable {
| ....
| @Entity
| @Table(name = "security_loan")
| @PrimaryKeyJoinColumn(name="security_id")
| public class SecurityLoan extends Security implements java.io.Serializable {
| ....
| @Entity
| @Table(name = "security_equity")
| @PrimaryKeyJoinColumn(name="security_id")
| public class SecurityEquity extends Security implements java.io.Serializable {
|
Is this possible?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087551#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...