geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milan Unger <milan.un...@siemens.com>
Subject deploying EJB with CMR
Date Fri, 27 Jan 2006 09:59:26 GMT
Hi,

I'm trying to deploy ear application with EJBs on Geronimo-1.0. The same
application deploys without a problem on Geronimo-1.0M5. After
transforming dependency format and parentIds for Geronimo 1.0 release I
still got following error from the deployer:

	Target TransactionBean does not have foreign key attribute
    transactionid.

Bellow are some snippets from openejb-jar.xml. Do you know a reason for
this problem?

Regards, Milan.

------------------------------ entities affected --------------
  <entity>
            <ejb-name>TransactionBean</ejb-name>
            <local-jndi-name>ejb/TransactionLocalHome</local-jndi-name>

            <table-name>transactions</table-name>
            <!-- table creation command -->
            <!--
            CREATE TABLE transactions(
            transactionid INTEGER NOT NULL PRIMARY KEY,
            ledgerid INTEGER NOT NULL,
            date DATE,
            marker VARCHAR(32))
            -->

            <cmp-field-mapping>
                <cmp-field-name>key</cmp-field-name>
                <table-column>transactionid</table-column>
            </cmp-field-mapping>
            <cmp-field-mapping>
                <cmp-field-name>date</cmp-field-name>
                <table-column>date</table-column>
            </cmp-field-mapping>
            <cmp-field-mapping>
                <cmp-field-name>marker</cmp-field-name>
                <table-column>marker</table-column>
            </cmp-field-mapping>

            <key-generator>
                <sequence-table>
                    <table-name>sequences</table-name>
                    <sequence-name>transaction</sequence-name>
                    <batch-size>1</batch-size>
                </sequence-table>
            </key-generator>

            <naming:resource-ref>
                <naming:ref-name>jdbc/CoordinatorDb</naming:ref-name>

<naming:resource-link>CoordinatorDataSource</naming:resource-link>
            </naming:resource-ref>
        </entity>
        <entity>
            <ejb-name>TransactionLineBean</ejb-name>
            <local-jndi-name>ejb/TransactionLineLocalHome</local-jndi-name>

            <table-name>tlines</table-name>
            <!-- table creation command -->
            <!--
            CREATE TABLE tlines (
            lineid INTEGER NOT NULL PRIMARY KEY,
            transactionid INTEGER NOT NULL,
            accountid INTEGER NOT NULL,
            side CHAR(1) DEFAULT 'C',
            ammount INTEGER,
            CONSTRAINT FK_TLINES_TRANSACTION FOREIGN KEY (transactionid)
               REFERENCES transactions(transactionid))
            -->

            <cmp-field-mapping>
                <cmp-field-name>key</cmp-field-name>
                <table-column>lineid</table-column>
            </cmp-field-mapping>
            <cmp-field-mapping>
                <cmp-field-name>side</cmp-field-name>
                <table-column>side</table-column>
            </cmp-field-mapping>
            <cmp-field-mapping>
                <cmp-field-name>ammount</cmp-field-name>
                <table-column>ammount</table-column>
            </cmp-field-mapping>

            <key-generator>
                <sequence-table>
                    <table-name>sequences</table-name>
                    <sequence-name>ledger</sequence-name>
                    <batch-size>10</batch-size>
                </sequence-table>
            </key-generator>

            <naming:resource-ref>
                <naming:ref-name>jdbc/CoordinatorDb</naming:ref-name>

<naming:resource-link>CoordinatorDataSource</naming:resource-link>
            </naming:resource-ref>
        </entity>

------------------ CMR causing the problem -----------------
<ejb-relation>
            <ejb-relationship-role>
                <relationship-role-source>
                    <ejb-name>TransactionBean</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>lines</cmr-field-name>
                </cmr-field>
                <role-mapping>
                    <cmr-field-mapping>
                        <key-column>transactionid</key-column>

<foreign-key-column>transactionid</foreign-key-column>
                    </cmr-field-mapping>
                </role-mapping>
            </ejb-relationship-role>
            <ejb-relationship-role>
                <relationship-role-source>
                    <ejb-name>TransactionLineBean</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>transaction</cmr-field-name>
                </cmr-field>
                <foreign-key-column-on-source/>
                <role-mapping>
                    <cmr-field-mapping>
                        <key-column>transactionid</key-column>


!!!!!!!!<foreign-key-column>transactionid</foreign-key-column>
<-----------this is attribute mentioned in error message !!!!!!!!!

                    </cmr-field-mapping>
                </role-mapping>
            </ejb-relationship-role>
        </ejb-relation>


Mime
View raw message