Hi,
Thank you very much for replying.
Actually my problem is not of aggregation, its of inheritance. B is inheriting
from A. You need not have an attribute of A in B for this.
the "super" attribute in reference descriptor is not an actual attribute of B , but it
is used to inform ojb that A is the super class of B
here is a snip from http://db.apache.org/ojb/tutorial3.html ( Advanced Object
Relational Mapping techniques ---> mapping inheritance hierarchies ---> mapping
classes on multiple joined tables)
=============================================
As you can see from this mapping we need a special reference-descriptor that advises
OJB to load the values for the inherited attributes from class A by a JOIN using the
(B.id == A.id) foreign key reference.
The name="super" is not used to address an actual attribute of the class B but as a
marker keyword defining the JOIN to the baseclass.
==============================================
This strategy is one of the three strategies used for mapping inheritance hierarchies
to tables. I get objects of both A and B when queried on class A If i use other
strategies (using <extent-class> tag) . But when i use "super" method , i only get A
objects (B objects are stripped to A so i dont get B's attributes).
Since table structures are already decided in our project, we have to use "super"
method.
Again my goal is to query on A.class to retrive objects of both A.class and B.class
Thanks
shibin
LAURENT Stephane <[EMAIL PROTECTED]> wrote:
Sorry but when I look this :
I think your class is like this :
class B
{
private int id;
private String email;
private A super;
/* getters and setters*/
}
So, it's an agregation (also extends but where is your type A attribute in B ?) and
you can add criteria("B.super",null)
Not sure to understand your goal ...
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software