Hi and thanks for all the help we've been given previously.

We've now moved from weblogic to jboss 3.0RC2 and are trying out xdoclet for
this. We've had a few problems doing this.One of the problems we have had
(this is using a version of XDoclet included with a cvs version of middlegen
BEFORE_CLASSTYPE_REFACTORING from 18.04) is that no column-names are added
to the jbosscmp-jdbc.xml file. e.g for this entry in our UserAccountBean
class (as generated by middlegen BEFORE_CLASSTYPE_REFACTORING from 18.04):


   /**
    * Returns the password
    *
    * @return the password
    *
    * @ejb:persistent-field
    * @ejb:interface-method view-type="local"
    *
    * @weblogic:dbms-column PASSWORD
    *
    * @jboss:column-name PASSWORD
    */
   public abstract java.lang.String getPassword();

   /**
    * Sets the password
    *
    * @param password the new password
    * @ejb:interface-method view-type="local"
    */
   public abstract void setPassword(java.lang.String password);

we get this in jbosscmp-jdbc.xml:

         <cmp-field>
            <field-name>password</field-name>

         </cmp-field>

in jaws.xml the column-name should be PASSWORD, but ends up the same as the
field-name. This is also the case for groupId which should have column-name
GROUP_ID and all other fields:

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

         </cmp-field>

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

         </cmp-field>

in ejb-jar.xml we get this:

         <cmp-field >
            <description><![CDATA[Returns the password]]></description>
            <field-name>password</field-name>
         </cmp-field>

We get exactly the same results when trying:

    * @jboss:column-name
    *   name = "PASSWORD"

as specified in a later documentation and:

    * @ejb:persistence
    *   column-name = "PASSWORD"

as the documentation says that the other things we have tried are
deprecated. What are we doing wrong?

Our second problem is with unidirectional relations. When we have a
unidirectional relation where the cmr-field is on the many side of a
one-to-many relation we've specified the relation like this and it works
fine:


   /**
    * Returns a collection of local Person
    *
    * @return a collection of local Person
    *
    * @ejb:interface-method view-type="local"
    *
    * @ejb:relation
    *    name="person-user_account"
    *    role-name="user_account-has-person"
    *    target-ejb="Person"
    *    target-role-name="person-has-user_account"
    *    target-multiple="yes"
    *
    * @weblogic:target-column-map
    *    foreign-key-column="PERSON_ID"
    *    key-column="PERSON_ID"
    *
    * @jboss:relation
    *    related-pk-field="personId"
    *    fk-column="PERSON_ID"
    */
   public abstract com.tcms.data.PersonLocal getPerson();

When the cmr-field is on the one side of the relation we've tried specifying
it like this:


   /**
    * Returns a collection of local Functions
    *
    * @return a collection of local Functions
    *
    * @ejb:interface-method view-type="local"
    *
    * @ejb:relation
    *    name="module-function"
    *    role-name="module-has-function"
    *    target-ejb="Function"
    *    target-role-name="function-has-module"
    *    target-multiple="no"
    *
    * @weblogic:column-map
    *    foreign-key-column="MODULEID"
    *    key-column="MODULEID"
    *
    * @jboss:target-relation
    *    fk-column="MODULEID"
    *    related-pk-field="moduleId"
    */
   public abstract java.util.Collection getFunctions();

and after inspecting jbosscmp-jdbc.xml we found that no key-fields were
entered in this case. It seems that anytime jboss:target-relation is used no
key-fields are specified in jbosscmp-jdbc.xml, if jboss:relation is used
they are specified.

the entry in jbosscmp-jdbc.xml for the first relation:

    <ejb-relation>
      <ejb-relation-name>person-user_account</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>

<ejb-relationship-role-name>user_account-has-person</ejb-relationship-role-n
ame>
          <key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>

<ejb-relationship-role-name>person-has-user_account</ejb-relationship-role-n
ame>
          <key-fields>
             <key-field>
               <field-name>personId</field-name>
               <column-name>PERSON_ID</column-name>
             </key-field>
          </key-fields>
      </ejb-relationship-role>
    </ejb-relation>

for the second relation:

    <ejb-relation>
      <ejb-relation-name>module-function</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>

<ejb-relationship-role-name>function-has-module</ejb-relationship-role-name>
          <key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>

<ejb-relationship-role-name>module-has-function</ejb-relationship-role-name>
          <key-fields/>
      </ejb-relationship-role>
    </ejb-relation>

Are we doing this right? The documentation says: If you replace
jboss:relation with jboss:target-relation, you can modify the blind side of
a unidirectional relationship. We think this is what we are doing. If this
is wrong, how should it be done?

We have tried newer versions of xdoclet from cvs, but haven't got any to
work as good as this one so we've stuck to it. If there is a stable version
of xdoclet on cvs that handles these problems can someone please point us to
it?Looking forward to the new release.

Thanks.

Lisa and Freddy


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to