Kyle Brown has written several articles pertaining to EJB inheritance wrt
Visual Age for Java. While what he talks about my not help you directly if
you are not using VAJ, you might be able to get some ideas from his
articles...

His third article (w/ links to the first two) is at:

http://www7.software.ibm.com/vad.nsf/FrameData/WebTechArticles?OpenDocument&;
FSet=2&Title=Technical_Articles&MastDoc=3005&Doc1=3025

Bill.

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Albrecht Scheidig
Sent: Thursday, October 05, 2000 3:42 AM
To: [EMAIL PROTECTED]
Subject: Inheritance with EJB


How do you model inheritance with EJB?

Imagine the following class graph:
classes:
A (abstract)
B extends A
C extends A
D
associations:
1 D associates n A

Using a relational database and having a
D-record you could query for the n A's
that satisfy the association using some-
thing like:

select <A-attributes> from B where B.ckey= ?
union
select <A-attributes> from C where C.ckey= ?

setting the "?" to the key of the D-record.
(This depends on you mapping.)

Using EJB I would like to call a finder to
A's Home-Interface which should return a
collection of A-instances - but that instan-
ces should be concrete B's or C's, which in
fact are A's too.
Sadly that is not possible. Using BMP the
finder must return the primary keys of B's
and C's and the container wraps them into
A-instances. Using CMP the container executes
the SQL-statement and wraps the primary keys
into A-instances too.

I do not want to build my own layer of mapping
for I think this is the responsibility of EJB.
Should I want it? Do you know a mapping tool
that satisfies multiple inheritance? TopLink?

I wonder how you model inheritance with EJB.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to