I have another EJB relationship issue that is pretty urgent....

Ok, when I save a CreditApplication with a BusinessCard (i.e. Product), the 
relationship works fine, and the DB is saved correctly. The issue is getting the data 
back out of the db in a relationship.
We have 4 products. Each with a productId, applicationId and productType. So when we 
get the Products back out of the db, and there is only 1 product saved (not 4), we 
actually get a BusinessCard returned for each product. It is actually the same 
BusinessCard (productId) for each Product. So it seems that the query is not looking 
for a compound PK (productId & productType) which is the query needed to distinguish 
between each product.



    /**
     *  Get  BusinessCard product for this CreditApplication.
     *  This is a one (CreditApplication) to one (BusinessCard) relationship.
     *  We can get a BusinessCardDto in the creditApplicationDto.getBusinessCard() 
method.
     *  We can also setBusinessCard( pBusinessCard )
     *
     * @ejb.interface-method view-type="local"
     *
     * @ejb.value-object
     *      compose="com.wf.bd.ice.product.BusinessCardDto"
     *      compose-name="BusinessCardDto"
     *      members="com.wf.bd.ice.product.BusinessCardLocal"
     *      members-name="BusinessCard"
     *      relation="external"
     *
     * @ejb.relation
     *      name="CreditApplication-BusinessCard"
     *      role-name="CreditApplication-has-BusinessCard"
     *      target-ejb="BusinessCard"
     *      target-role-name="BusinessCard-belongs_to-CreditApplication"
     *      target-cascade-delete="yes"
     *
     *  TODO: We may be required to add an additional column
     *        to the Business view to support the 1 -- 1
     *        relationship of the BusinessCard and CreditApplication
     *
     * @weblogic.target-column-map
     *      foreign-key-column="applicationId"
     *      key-column="applicationId"
     */
    public abstract com.wf.bd.ice.product.BusinessCardLocal getBusinessCard();

    /**
     * @ejb.interface-method view-type="local"
     **/
    public abstract void setBusinessCard( com.wf.bd.ice.product.BusinessCardLocal 
pBusinessCardLocal );



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to