You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Necro <Ne...@komdat.de> on 2003/09/04 15:46:33 UTC
Question about inheritence
Hi,
i'd like to do the following. I have classes A, B and C.
A is superclass of B and B is superclass of C. There are
the following entries in the repository.xml file
<class-descriptor class="A" table="a">
<field-descriptor name="id" column="id" ... />
...
</class-descriptor>
<class-descriptor class="C" table="c">
<field-descriptor name="id" column="id" ... />
<field-descriptor name="additionalvalue" ... />
<reference-descriptor name="super" class-ref="A">
<foreign-key field-ref="id" />
</reference-descriptor>
</class-descriptor>
As you can see I don't want to add any persistence to B.
B just adds some additional methods, no values.
The problem is, I get an exception in the class
org.apache.ojb.broker.metadata.RepositoryXmlHandler
because the checkThis method checks whether A is the
direct superclass of C which is not the case.
My question is, does it really need to be the direct
superclass? Are there any workarounds? What else can
I do?
Tanks
christof
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Question about inheritence
Posted by Necro <Ne...@komdat.de>.
Thomas Dudziak wrote:
> Perhaps adding an extent-class to the descriptor for A helps ?
Sorry, i did forget to mention that. Yes there is an extent-class.
The problem is, the method checkThis() ignores this information.
It only checks, whether (something like the following)
C.class.getSuperclass().getName().equals(A.class.getName()), which is
not the case, because B is in between.
> <class-descriptor class="A" table="a">
> <extent-class class-ref="C"/>
> ...
> </class-descriptor>
>
> Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Question about inheritence
Posted by Thomas Dudziak <to...@first.gmd.de>.
Perhaps adding an extent-class to the descriptor for A helps ?
<class-descriptor class="A" table="a">
<extent-class class-ref="C"/>
...
</class-descriptor>
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org