Bugs item #528557, was opened at 2002-03-11 19:00
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=528557&group_id=31602

Category: ejbdoclet
Group: v1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Joni Suominen (inhuman)
Assigned to: Nobody/Anonymous (nobody)
Summary: inheritance of CMR (@ejb:relation) fails

Initial Comment:
Inheriting a CMR declaration (@ejb:relation) produces
an incorrect <ejb-name> value in <relationships>
declaration.


Let's say that we have three components (entity beans):
User, CatalogItem and Product. User has one-many CMR
for abstract CatalogItem and Product extends
CatalogItem.

UserEJB:
/**
 * @ejb:bean         type="CMP" 
 *                   name="User" 
 *                   local-jndi-name="ejb/User" 
 *                   view-type="local" 
 *                   primkey-field="id"
 *
 */
public abstract class UserEJB implements EntityBean {
  /**
   * A user can have items in a catalog.
   * Bidirectional one-many.
   * @ejb:interface-method   view-type="local"
   * @ejb:relation           name="UserCatalogItems" 
   *                 role-name="UserOwnsCatalogItems"
   */
  public abstract Collection getCatalogItems();
  public abstract void setCatalogItems(Collection items);
}

CatalogItemEJB:
/**
  *
  * @ejb:bean        type="CMP" 
  *                  view-type="local" 
  *                  primkey-field="id"
  *                  generate="false"
  *   
  */
public abstract class CatalogItemEJB implements
EntityBean {
  /**
   * The owner of this item. many-one
   * 
   * @ejb:relation    name="UserCatalogItems"
   *                role-name="CatalogItemHasOwner"
   */
  public abstract UserLocal getOwner();
  public abstract void setOwner(UserLocal user);
}

ProductEJB:
/**
 * @ejb:bean    type="CMP"
 *              name="Product"
 *              local-jndi-name="ejb/Product"
 *              view-type="local"
 */
public abstract class ProductEJB extends CatalogItemEJB
implements EntityBean {
}



Xdoclet generates following <relationships> declaration:

<relationships >
<ejb-relation >
<ejb-relation-name>UserCatalogItems</ejb-relation-name>
<!-- bidirectional -->
<ejb-relationship-role >
<ejb-relationship-role-name>UserOwnsCatalogItems</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source >
<ejb-name>User</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>catalogItems</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role >
           
<ejb-relationship-role-name>CatalogItemHasOwner</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source >
<ejb-name>test.CatalogItem</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>owner</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
</relationships>

The second part of the relationship is incorrect. It
declares <ejb-name>test.CatalogItem</ejb-name>. Since
CatalogItem is abstarct, there is not a bean deployed
by that name. It should be
<ejb-name>Product</ejb-name>, since Product extends
CatalogItem.



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=528557&group_id=31602

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to