openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbee <>
Subject Re: Open JPA error-Could not locate metadata for the class using alias
Date Fri, 20 Apr 2007 17:19:47 GMT

Marina Vatkina wrote:
> The spec defines the following limitations of a MappedSuperclass:
> Mapped Superclasses
> ...
> A mapped superclass, unlike an entity, is not queryable and cannot be
> passed as 
> an argument to EntityManager or Query operations. A mapped superclass
> cannot be 
> the target of a persistent relationship.

Correct. It is not. All relations refer to the inheriting classes. So even
if the relation is defined in the @MappedSuperclass, the result of the
relation are the actual @Entity.

I believe this approach is invaluable if you want to save coding time: my
reverse engineering class generates a JPA MappedSuperclass based on the
database and the actual Entity class only contains the JPA table annotation
and all business logic.

Hibernate also has some trouble with this concept, but Toplink works fine. I
have an issue with lazy loading there, but the approach is perfect.

View this message in context:
Sent from the open-jpa-dev mailing list archive at

View raw message