Hi, According to openjpa manual: "Unlike true entities, you cannot query a mapped superclass"
http://openjpa.apache.org/builds/latest/docs/manual/manual.html#jpa_overview_meta_embeddablesuper --- On Mon, 4/20/09, jim weaver <[email protected]> wrote: > From: jim weaver <[email protected]> > Subject: Can't query against a MappedSuperclass > To: [email protected] > Date: Monday, April 20, 2009, 12:38 PM > > I have the following: > > @MappedSuperclass class A { } > @Entity class B extends A { } > @Entity class C extends A { } > > and I try to do this type of query: SELECT a FROM A a > > I receive error message "An error occurred while parsing > the query filter > "SELECT a FROM A a". Error > message: The name "A" is not a recognized > entity or identifier. Perhaps you meant B, which is a > close match. Known > entity names: [B, C]" > > A is defined in my persistence.xml and my tables do have > the inherited > fields from it so I'm pretty sure jpa is recognizing it. > > The OpenJPA doc says that the query is supported.....this > is from the 1.2.0 > doc: > > Note > OpenJPA allows you to query on mapped superclasses. A query > on a mapped > superclass will return all matching subclass instances. > > > -- > View this message in context: > http://n2.nabble.com/Can%27t-query-against-a-MappedSuperclass-tp2665700p2665700.html > Sent from the OpenJPA Users mailing list archive at > Nabble.com. > >
