Hi, I'm new to hibernate and I want to know if this is possible:
@MappedSuperclass
abstract class generalClass
-string name
---------------------------------
class firstNarrowClass extends generalClass
@Id
-long id
----------------------------------
class secondNarrowClass extends generalClass
@Id
-long id
Here are my classes. From these classes, when I try to use HQL and execute the statement "FROM generalClass", it doesn't give me the right result. I have looked into the StrategyType JOINED but this only works if the abstract class have the id field. I'm trying to get two different tables with their own id fields instead of the super class holding it. Also, I tried doing "FROM firstNarrowClass UNION FROM secondNarrowClass" but this does not work also. Does anybody know of a way to achieve this? Thanks.
|