db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: Referencing an abstract class. The next turn...
Date Tue, 12 Oct 2004 12:44:07 GMT


Carsten Spräner_Ext wrote:
> Hi Armin,
> 
> i looked at the test ojb....broker.InheritanceMultipleTableTest and didn't
> find a place where you do a query to an Employee and than do a cast to, for
> example, Manager. But that's exactly what i need. When mapping all classes
> in one table this is possible. The test case should be:
> 
>  1. query for all Employees where name like 'manager'. But create the query
> with Employee.class.
>  2. assert that all loaded classes are instances of Manager.
>  3. assert that a attribute which is only in Manager is loaded.
> 
> If this test case works it would be very nice.
>

yep, this is the issue - OJB doesn't.
If you iterate and print the class types of the query result against 
Employee then you only get Employee types.

Think this is a "bug" in consistence of inheritance behavior in OJB, 
because the other "inheritance mapping strategies" work different and 
will return the real classes not only base class instances.

I will add a test to reproduce your problem.

regards,
Armin

> Best regards....
> 
> 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


Mime
View raw message