File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Entity EJB Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Entity EJB Inheritance" Watch "Entity EJB Inheritance" New topic

Entity EJB Inheritance

Richard Reynolds

Joined: Aug 24, 2004
Posts: 5
I have bean B extends A. In A I have a cmp field, x. getX() and setX are inherited by B, no probs.
However, in ejb-jar.xml I have to repeat the cmp field x for A and B.
Similarly for relationships, A has a 1 to many rel with C, the cmr code is inherited yet I have to specify the same rel xml block for A to C and B to C.
I have a lot of inheritance, cmp fields and relationships which results in a huge ejb-jar.xml file (and an even bigger weblogic-cmp-rdbms-jar.xml file as I'm using wls 8.1 and this file requires all the repitition too).
Is there a way to tell the server that the xml blocks are inherited too?

Cheers, Richard.
Terry Mullett

Joined: Feb 21, 2003
Posts: 26
Nope, sorry. Or at least, not in a vendor neutral way. Bean-isms, endowed by the container, aren't inheritable, and don't have any connection to what your bean implementation class has going on with Java inheritance.

somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I'm found tutorial about EJB inheritance:::

Part 1

Part 2

Part 3

This will help you.

Java Developer, Thailand
Richard Reynolds

Joined: Aug 24, 2004
Posts: 5
My inheritance is working fine, just the repetitive xml that was annoying.
Oh well, guess i'll just have to put up with it.

Those articles are very good, they were my initial guide in setting up my hierarchy.

Thanks guys.
I agree. Here's the link:
subject: Entity EJB Inheritance
It's not a secret anymore!