Unable to use the relationship between the BEans
Hi All,
I am deploying two Simple CMP Entity Beans in WebLoic8.1 and getting the Error:
[EJB:011020]The database table: MYCUSTOMER does not contain the columns: . Please
consult your database mappings in the weblogic-cmp-rdbms.xml deployment descriptor
and ensure these match your database schema.
==================================================================
Here are my DB Scripts..
==================================================================
create table mycustomer(
cust_id number,
firstName varchar2(25),
lastName varchar2(25),
Address varchar2(100),
phone varchar2(25)
)
alter table mycustomer add constraint
CN_MYCUSTOMER_PK
PRIMARY KEY (CUST_ID)
create table MYACCOUNT(
account_id number not null,
account_type number,
balance number(10,5),
cust_id number not null
)
alter table myaccount add constraint
CN_MYACCOUNT_PK
PRIMARY KEY (ACCOUNT_ID)
alter table myaccount add constraint
CN_MYACCOUNT_MYCUSTOMER_FK
FOREIGN KEY (CUST_ID)
REFERENCES MYCUSTOMER;
==================================================================
relationships node in ejb-jar.xml
==================================================================
<relationships>
<ejb-relation>
<ejb-relation-name>customer-account</ejb-relation-name>
<ejb-relationship-role>
<description>customer</description>
<ejb-relationship-role-name>Customer-has-many-Accounts</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<description>customer</description>
<ejb-name>Customer</ejb-name>
</relationship-role-source>
<cmr-field>
<description>account</description>
<cmr-field-name>account</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<description>account</description>
<ejb-relationship-role-name>Account-Belongs-to-One-Customer</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<description>account</description>
<ejb-name>Account</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>
==================================================================
and the weblogic-rdbms-rlation element from weblogic-cmp-rdbms-jar.xml
==================================================================
<weblogic-rdbms-relation>
<relation-name>customer-account</relation-name>
<weblogic-relationship-role>
<relationship-role-name>Account-Belongs-to-One-Customer</relationship-role-name>
<relationship-role-map>
<foreign-key-table>MYACCOUNT</foreign-key-table>
<primary-key-table>MYCUSTOMER</primary-key-table>
<column-map>
<foreign-key-column>CUST_ID</foreign-key-column>
<key-column>CUST_ID</key-column>
</column-map>
</relationship-role-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
==================================================================
Why i am getting this Error. ?? The <key-column> should point to the primary
key of MYACCOUNT Table or to the Primary Key of MYCUSTOMER Table ? I tried both
the options but still getting Errors.
Pls let me know..
Thanks
Sateesh
Re: Unable to use the relationship between the BEans
Is that the complete error message ? That is, the error message does not list
any of the names of the columns that it thinks is missing ?
Re: Unable to use the relationship between the BEans
Hi ,
Thanks for your reply.. The Server gave the Column names in the Error msg
I deployed the app using JBuilderX and it seems some how JBuilderX didn'd deploy
the latest files..
Now it is resolved thanks again..
-Sateesh
"thorick" <thorick@bea.com> wrote:[color=blue]
>
>
>
>
>Is that the complete error message ? That is, the error message does
>not list
>any of the names of the columns that it thinks is missing ?
>
>[/color]