You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Carsten Spräner_Ext <CS...@provinzial-online.de> on 2004/03/16 16:22:11 UTC

Inheritance with anonymous access

Hallo,

Problem:
Having class "A" and a derived class "B" extends "A". The classes "A" ann
"B" are mapped on different tables and the relation is mapped as a "super"
reference from "B" to "A". A query on "A" to an instance of B loads only
the data of A. So i use the ojbConcreteClass field and the data of "B" will
be loaded.

Now i made a query in "B" with the ojbConcreteClass field defined. Than ojb
crashes.
The problem is, that ojb tries to load "B" and finds a reference to "A". So
ojb tries to load "A" and sees the ojbConcreteClass field which tells it to
load an instance of "B". At this moment the fk- Values of the created
instance of class "B" is not defined and i get an error that all fk- Values
are null.

any solutions?

The problem gets more difficult if there is another class "C" which has
references to class "A". Ojb can not load the instances of "B" while
loading an instance of "C". Is it possible to map another field to the real
class name an to write an own RowReaderImplementation which uses this new
field to solve the problem?

btw.: When will there be a final version of 1.0? i think the home page
tells it will be in the next two weeks, but this statement is from about
Christmas! Please make it! OJB is good enough for a 1.0 release. And we are
wating for it!

Thank you all for your work...

carsten





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: Inheritance with anonymous access

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi carsten,

could you please post the repository and a stacktrace.

jakob

Carsten Spräner_Ext wrote:

> Hallo,
> 
> Problem:
> Having class "A" and a derived class "B" extends "A". The classes "A" ann
> "B" are mapped on different tables and the relation is mapped as a "super"
> reference from "B" to "A". A query on "A" to an instance of B loads only
> the data of A. So i use the ojbConcreteClass field and the data of "B" will
> be loaded.
> 
> Now i made a query in "B" with the ojbConcreteClass field defined. Than ojb
> crashes.
> The problem is, that ojb tries to load "B" and finds a reference to "A". So
> ojb tries to load "A" and sees the ojbConcreteClass field which tells it to
> load an instance of "B". At this moment the fk- Values of the created
> instance of class "B" is not defined and i get an error that all fk- Values
> are null.
> 
> any solutions?
> 
> The problem gets more difficult if there is another class "C" which has
> references to class "A". Ojb can not load the instances of "B" while
> loading an instance of "C". Is it possible to map another field to the real
> class name an to write an own RowReaderImplementation which uses this new
> field to solve the problem?
> 
> btw.: When will there be a final version of 1.0? i think the home page
> tells it will be in the next two weeks, but this statement is from about
> Christmas! Please make it! OJB is good enough for a 1.0 release. And we are
> wating for it!
> 
> Thank you all for your work...
> 
> carsten
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org