Hi!

I'm trying to use inheritance within entity beans. The superclass defines a set of CMR 
methods which should be used in the subclass without the need to declare them in the 
subclasses again. 1xN relations don't make any trouble i think, but NxM relations will 
do.

To make my problem a little more concrete:

I have a entity bean called "DeviceBean" and to subclasses "FTPDeviceBean" and 
"FTAMDeviceBean". Each subclass has a set of additional attributes. All entity beans 
are mapped in different tables. All entries have a unique id (Integer) which is unique 
within all device tables.

Next, the "DeviceBean" defines a bidirectional relation to a "PollingCycleBean" which 
will be mapped in a relation table.

(I hope may bad "ASCII arts" makes my problem clear :)

DeviceBean n<------------------>m PolingCycleBean
|-- FTPDeviceBean -------------------^ should also use relation
|-- FTAMDeviceBean -----------------^ should also use relation


Relation table:
______________________
|device_id (pk)| pc_id (pk)|
______________________


To use the relation in my subclasses I have to declare the relation in the ejb-jar.xml 
for each subclass with a unique name.

But next step will make trouble i think. Associating a FTP-device with a new polling 
cycle will add an entry to the relation table. But can the container make an inverse 
lookup and return the associated devices (FTP- and FTAM-devices) which are stored in 
different tables ?

Can I use bidirectional NxM CMR in subclasses with JBoss 3.2 ?

Thanks a lot for bringing some more light in my understanding of the abilities of CMR.

Regards,
Marcel



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3842505#3842505

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3842505


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to