I have the following constellation
Unit
Section extends Unit
Chapter extends Unit
Unit has two methods getParent() and getChildren() that are mapped via a ManyToOne/OnToMany
Now, if a Section is parent to a Chapter, what should the getParent() call return? I expected, that the inheritance is respected with this mapping, but the call returns a Unit-Object.
This, of course is consistent with the targetEntity determined by the getParent():Unit-Call - but if breaks the Type-Scheme. Is there a way around this? Casting, of course, does not work, as the parent is only fetched with the data for Unit and misses all Section-Fields....
thx for the help!
stf
|