This content has been marked as final.
Show 1 reply
-
1. Re: abstract entity and subclasses for components
sean.tozer Aug 13, 2010 9:53 AM (in response to robshep)Try the following mapping:
@MappedSuperClass abstract class User { ... }
@Entity @Table(..) class UserA extends User { ... }
That will map UserA to the correc table, whatever it is in your setup, while still alowing both user types to be stored in a User variable. The trick of course is the MappedSuperClass, which makes Seam (through Hibernate) aware of the class and hierarchy without actually trying to map it to any instantiable entity.