Following is my jbosscmp-jdbc

  | <jbosscmp-jdbc>
  |    <defaults>
  |    </defaults>
  | 
  |    <enterprise-beans>
  | 
  |      <!--
  |        To add beans that you have deployment descriptor info for, add
  |        a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
  |        that contains the <entity></entity> markup for those beans.
  |      -->
  | 
  |       <entity>
  |          <ejb-name>Site</ejb-name>
  | 
  |          <cmp-field>
  |             <field-name>description</field-name>
  |             <column-name>description</column-name>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>siteCode</field-name>
  |             <column-name>site_code</column-name>
  | 
  |         </cmp-field>
  | 
  | <!-- jboss 3.2 features -->
  | <!-- optimistic locking does not express the exclusions needed -->
  |       </entity>
  | 
  |       <entity>
  |          <ejb-name>Location</ejb-name>
  | 
  |          <cmp-field>
  |             <field-name>description</field-name>
  |             <column-name>description</column-name>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>locationCode</field-name>
  |             <column-name>location_code</column-name>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>siteCode</field-name>
  |             <column-name>site_code</column-name>
  | 
  |         </cmp-field>
  | 
  | <!-- jboss 3.2 features -->
  | <!-- optimistic locking does not express the exclusions needed -->
  |       </entity>
  | 
  |    </enterprise-beans>
  | 
  |   <relationships>
  |     <ejb-relation>
  |       <ejb-relation-name>site-locations</ejb-relation-name>
  | 
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>location-belongs_to-site</ejb-relationship-role-name>
  |               <key-fields/>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>site-has-locations</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>siteCode</field-name>
  |                <column-name>site_code</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  |   </relationships>
  | 
  | </jbosscmp-jdbc>
  | 

This is the relationship section of the ejb-jar.xml

  |    <!-- Relationships -->
  |    <relationships >
  |       <ejb-relation >
  |          <ejb-relation-name>site-locations</ejb-relation-name>
  | 
  |          <ejb-relationship-role >
  |             
<ejb-relationship-role-name>location-belongs_to-site</ejb-relationship-role-name>
  |             <multiplicity>Many</multiplicity>
  |             <relationship-role-source >
  |                <ejb-name>Location</ejb-name>
  |             </relationship-role-source>
  |             <cmr-field >
  |                <cmr-field-name>site</cmr-field-name>
  |             </cmr-field>
  |          </ejb-relationship-role>
  | 
  |          <ejb-relationship-role >
  |             
<ejb-relationship-role-name>site-has-locations</ejb-relationship-role-name>
  |             <multiplicity>One</multiplicity>
  |             <relationship-role-source >
  |                <ejb-name>Site</ejb-name>
  |             </relationship-role-source>
  |             <cmr-field >
  |                <cmr-field-name>locations</cmr-field-name>
  |                <cmr-field-type>java.util.Collection</cmr-field-type>
  |             </cmr-field>
  |          </ejb-relationship-role>
  | 
  |       </ejb-relation>
  |    </relationships>
  | 

Follwoing are the two beean codes
SiteBean.java

  |     /**
  |      * DOCUMENT ME!
  |      *
  |      * @ejb.interface-method
  |      */
  |     public abstract void setLocations(Collection locations);
  | 
  |     /**
  |      * DOCUMENT ME!
  |      *
  |      * @return to be documented!
  |      *
  |      * @ejb.interface-method
  |      * @ejb.relation name="site-locations" role-name="site-has-locations"
  |      * @ejb.value-object 
aggregate="lk.ozone.o3synergy.o3storekeeper.common.to.location.LocationTO"
  |      *      aggregate-name="Location" 
members="lk.ozone.o3synergy.o3storekeeper.bo.ejb.location.LocationLocal"
  |      *      members-name="Locations" relation="external" 
type="java.util.Collection"
  |      */
  |     public abstract Collection getLocations();
  | 

LocationBean.java

  |     /**
  |      * Sets the SiteLocal of the location
  |      *
  |      * @ejb.interface-method
  |      */
  |     public abstract void setSite(SiteLocal site);
  | 
  |     /**
  |      * Get the SiteLocal of the location
  |      *
  |      * @return SiteLocal
  |      *
  |      * @ejb.interface-method
  |      * @ejb.relation name="site-locations" role-name="location-belongs_to-site" 
cascade-delete="no"
  |      * @jboss.relation related-pk-field="siteCode" fk-column="site_code"
  |      */
  |     public abstract SiteLocal getSite();
  | 

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

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



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to