persistence@glassfish.java.net

abstract entity superclasses

From: jeff <farble1670_at_yahoo.com>
Date: Fri, 9 Mar 2007 12:55:29 -0800 (PST)

i have class Bar extends Foo. i want Foo to contain persistent fields inherited by Bar, but i also want Foo to be abstract.

is this possible? if i leave the @Entity annotation, then i get an error telling me that the class cannot be instantiated (right, it's abstract). this sort of puzzles me though because i never try to create any instances of it.

if i remove the entity annotation, i get an error at runtime from Bar saying it can't find the ID ... the ID field is defined in the abstract base class Foo.

any ideas?
thanks.

 
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.