I have searched far and wide to find the answer to this one with no luck. 
Inside of the jbosscmp-jdbc.xml I need to have the <foreign-key-mapping/> tag 
inside of my ejb-relation definition. I cannot find anywhere how to have this 
generated from XDoclet, can anyone tell me the tag?
 Thanks.

This is an example of my XDoclet Definitions for the relations Im using :
        /**
  |      * Getter for CMR Relationship
  |      *
  |      *
  |      * @ejb.interface-method   view-type="local"
  |      * @ejb.relation           name = "person-to-task"
  |      *                               role-name = "task-has-persons"
  |      *                               target-multiple = "yes"
  |      *                   
  |      * @jboss.relation      related-pk-field = "id"
  |      *                              fk-column = "TASK_ID"           
  |      * 
  |      * @ejb.value-object aggregate = 
"com.digitalhome.interfaces.PersonValue"
  |      *                                       aggregate-name = "Person"
  |      *                                       members = 
"com.digitalhome.interfaces.PersonLocal"
  |      *                                       members-name = "Persons"
  |      *                                       relation = "external"
  |      *                                       type="java.util.Set"           
                          
  |      */
  | 
  | 

And here is the output in jbosscmp-jdbc.xml


  |  <relationships>
  |     <ejb-relation>
  |       <ejb-relation-name>task-comment</ejb-relation-name>
  | <!--  THE FOREIGN-KEY-MAPPING TAG NEEDS TO GO HERE! -->
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>comment-belongs-to-task</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>TASK_ID</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>task-has-comments</ejb-relationship-role-name>
  |               <key-fields/>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  |     <ejb-relation>
  |       <ejb-relation-name>person-to-task</ejb-relation-name>
  |       <relation-table-mapping>
  |       </relation-table-mapping>
  | 
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>person-has-tasks</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>TASK_ID</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>task-has-persons</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>PERSON_ID</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  |      <!-- 
  |        To add jboss relationships for beans not managed by XDoclet, add
  |        a file to your XDoclet merge directory called 
jbosscmp-jdbc-relationships.xml that contains
  |        the <ejb-relation></ejb-relation> markups for those beans.
  |      --> 
  |   </relationships>

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3915919#3915919

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3915919


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to