Hello,
I'm trying to deploy two CMP Entity Beans on BEA weblogic, database is
Oracle 8i.
The beans are called "OrderMaster" and "OrderDetail and their corresponding
database tables(all fields indicated are part of the respective primary
key!) are:
ORDERS (orderNumber, ....)
ORDERITEMS (orderNumber, artist, title, ...)
In ORDERITEMS orderNumber is foreign key. There is a 1:N relationship
between both related Entity Beans. There is a primary key class
"OrderDetailEBPK" for the composite key of ORDERITEMS.
When deploying only "OrderMaster" Entity Bean everything works fine. But
when I try to deploy both Entity Beans together(in a relation), I get
following message:
.....a single column mapping must be given for each primary key column in
the bean referenced by the mapping.....
This message refers to the following part of weblogic-cmp-rdbms-jar.xml
file:
<weblogic-rdbms-relation>
<relation-name>OrderItemsRelation</relation-name>
<table-name>orders</table-name>
<weblogic-relationship-role>
<relationship-role-name>order-has-items</relationship-role-name>
<column-map>
<foreign-key-column>orderNumber</foreign-key-column>
<key-column>orderNumber</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
What part is missing on weblogic-cmp-rdbms-jar and how it should be
declared?
Is there any further consideration to be done when using a composite key?
Is it a problem regarding support of composite primary key mapping (BEA,
Oracle)?
Very grateful for any help!
Thanks in advance!
Best regards,
Wolf
P.S.: Below some more detailed extracts of deployment descriptors
----------------------------------------------------------------------------
Extract of weblogic-cmp-rdbms-jar.xml:
<weblogic-rdbms-bean>
<ejb-name>orderDetailEntity</ejb-name>
<data-source-name>OrderDetailSource</data-source-name>
<table-name>orderItems</table-name>
<field-map>
<cmp-field>orderNumber</cmp-field>
<dbms-column>orderNumber</dbms-column>
</field-map>
<field-map>
<cmp-field>artist</cmp-field>
<dbms-column>artist</dbms-column>
</field-map>
<field-map>
<cmp-field>title</cmp-field>
<dbms-column>title</dbms-column>
</field-map>
</weblogic-rdbms-bean>
<weblogic-rdbms-relation>
<relation-name>OrderItemsRelation</relation-name>
<table-name>orders</table-name>
<weblogic-relationship-role>
<relationship-role-name>order-has-items</relationship-role-name>
<column-map>
<foreign-key-column>orderNumber</foreign-key-column>
<key-column>orderNumber</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
Extract of ejb.jar.xml:
<relationships>
<ejb-relation>
<ejb-relation-name>OrderItemsRelation</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>order-has-items</ejb-relationship-role-name>
<multiplicity>one</multiplicity>
<role-source>
<ejb-name>orderMasterEntity</ejb-name>
</role-source>
<cmr-field>
<cmr-field-name>assignedItems</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>item-belongs-order</ejb-relationship-role-name>
<multiplicity>many</multiplicity>
<role-source>
<ejb-name>orderDetailEntity</ejb-name>
</role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>
--------------------------------------------------------------------------
===========================================================================
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".