1 Reply Latest reply on Feb 7, 2004 9:24 AM by msalgado

    jbosscmp-jdbc_3_2.dtd version

    ben holland Newbie

      hi,

      I have ammended a jbosscmp-jdbc.xml file to point at the 3_2.dtd version.

      However, when I deploy the bean I get an error telling me the xml doc does not match the dtd:

      Error message: Element type "auto-increment" must be declared.
      Error message: The content of element type "cmp-field" must match "(field-name,read-only?,read-time-out?,column-name?,not-null?,((jdbc-type,sql-type)|property+)?)".

      auto increment does appear in the jboss3.2 dtd.

      How do I force Jboss to use the new version of the dtd?
      I thought the fact it was defined in the jar file would force it.

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jbosscmp-jdbc PUBLIC
      "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

      <jbosscmp-jdbc>

      java:/mySQL
      <datasource-mapping>mySQL</datasource-mapping>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <pk-constraint>true</pk-constraint>
      <fk-constraint>true</fk-constraint>
      <!--<preferred-relation-mapping>foreign-key</preferred-relation-mapping> -->
      <!-- <unknown-pk>
      <unknown-pk-class>java.lang.Integer</unknown-pk-class>
      <field-name>CustomerDetailsID</field-name>
      <column-name>pk_id</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>INT(11)</sql-type>
      <auto-increment/>
      </unknown-pk>
      <entity-command name="key-generator"/> -->



      <enterprise-beans>

      <ejb-name>Customer</ejb-name>
      <table-name>mvdc_customer</table-name>
      <cmp-field>
      <field-name>CustomerID</field-name>
      <column-name>customer_id</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>PassWord</field-name>
      <column-name>pword</column-name>
      <not-null/>
      </cmp-field>



      <ejb-name>CustomerDetails</ejb-name>
      <table-name>mvdc_customer_details</table-name>

      <cmp-field>
      <field-name>CustomerDetailsID</field-name>
      <column-name>pk_id</column-name>
      <auto-increment/>
      </cmp-field>

      <cmp-field>
      <field-name>UserName</field-name>
      <column-name>user_name</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>Surname</field-name>
      <column-name>surname</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>PhoneNo</field-name>
      <column-name>phone_no</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>Address</field-name>
      <column-name>address</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>EmailAddress</field-name>
      <column-name>email_address</column-name>
      </cmp-field>



      <ejb-name>Account</ejb-name>
      <table-name>mvdc_customer_account</table-name>
      <cmp-field>
      <field-name>AccountNumber</field-name>
      <column-name>pk_account_number</column-name>
      </cmp-field>

      <cmp-field>
      <field-name>IsActive</field-name>
      <column-name>is_active</column-name>
      </cmp-field>




      <ejb-name>AccountType</ejb-name>
      <table-name>mvdc_account_type</table-name>
      <cmp-field>
      <field-name>AccountType</field-name>
      <column-name>pk_id</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>
      </cmp-field>



      </enterprise-beans>


      <ejb-relation>
      <ejb-relation-name>customer-customerdetails</ejb-relation-name>
      <foreign-key-mapping/>

      <ejb-relationship-role>
      <ejb-relationship-role-name>customer-has-details</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>CustomerID</field-name>
      <column-name>fk_customer_id</column-name>
      </key-field>
      </key-fields>

      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>details-for-customer</ejb-relationship-role-name>

      <key-fields/>
      </ejb-relationship-role>
      </ejb-relation>
      <ejb-relation>
      <ejb-relation-name>customer-account</ejb-relation-name>
      <foreign-key-mapping/>

      <ejb-relationship-role>
      <ejb-relationship-role-name>customer-has-accounts</ejb-relationship-role-name>

      <key-fields>
      <key-field>
      <field-name>CustomerID</field-name>
      <column-name>fk_customer_id</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>accounts-for-customer</ejb-relationship-role-name>
      <key-fields/>
      </ejb-relationship-role>
      </ejb-relation>

      <ejb-relation>
      <ejb-relation-name>account-accountType</ejb-relation-name>
      <foreign-key-mapping/>

      <ejb-relationship-role>
      <ejb-relationship-role-name>account-has-accountType</ejb-relationship-role-name>


      </ejb-relationship-role>
      <ejb-relationship-role>

      <ejb-relationship-role-name>accountType-for-account</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>AccountType</field-name>
      <column-name>fk_account_type</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      </ejb-relation>


      </jbosscmp-jdbc>