Thanks again for your help. Indeed that doctype definition is missing! I will add it and try the key trick and report later on the result Thanks again
Christian
From: Alexey Loubyansky <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Spurious fields in the SQL Insert of a EJB 2.0 bean with One-to-One relations
Date: Wed, 12 Nov 2003 13:39:25 +0200
Percy Christian wrote:
Thanks for your kind support.
Here is the insert SQL
INSERT INTO CONTACT (CONTACT_ID, NAME, ADDRESS, TEL1, TEL2, TEL3, GSM, FAX, EMAIL, URL, IBAN_CODE, BIC, COMMENTS, CREATION_DATE, LOCALITY_ID, Manufacturer_contact) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
And yes it deploys correctly without errors.
Does the jbosscmp-jdbc.xml have the doctype definition?
<!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
Could you give me a hint on what and how to change the XML file to make it compliant?
jbosscmp-jdbc_3_2.dtd
An example of a One-To-One relation with only <key-fields> on one side would be extra super.
Many many thanks.
Try to add an empty <key-fields/> element for the ejb-relationship-role in jbosscmp-jdbc.xml that does not have key-fields element.
I can even define the an <cmr-field> element in the <ejb-relationship-role> element that has no <key-fields> element in the jbosscmp-jdbc.xml file
Like this: Here is the XML entry from the ejb-jar XML file
<ejb-relation>
<ejb-relation-name>manufacturer-contact</ejb-relation-name>
<ejb-relationship-role>
<description>manufacturer</description>
<ejb-relationship-role-name>ManufacturerRelationshipRole</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<description>manufacturer</description>
<ejb-name>Manufacturer</ejb-name>
</relationship-role-source>
<cmr-field>
<description>contact</description>
<cmr-field-name>contact</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<description>contact</description>
<ejb-relationship-role-name>ContactRelationshipRole</ejb-relationship-role-name>
<multiplicity>One</multiplicity> <relationship-role-source> <description>contact</description> <ejb-name>Contact</ejb-name> </relationship-role-source> <cmr-field> <description> manufacturer </description> <cmr-field-name> manufacturer </cmr-field-name> </cmr-field> </ejb-relationship-role> </ejb-relation>
The the insert SQL changes to
INSERT INTO CONTACT (CONTACT_ID, NAME, ADDRESS, TEL1, TEL2, TEL3, GSM, FAX, EMAIL, URL, IBAN_CODE, BIC, COMMENTS, CREATION_DATE, LOCALITY_ID, manufacturer) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
_________________________________________________________________ MSN Search, for relevant search results! http://search.msn.be
------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user