Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity EJB Inheritance

 
Richard Reynolds
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Terry
SCEA/SCBCD/SCWCD/SCJP
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm found tutorial about EJB inheritance:::

Part 1

Part 2

Part 3


This will help you.
 
Richard Reynolds
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic