Hi David!

Sorry, it was my error in saying "I am unable to generate the VO on the one
side".

I am able to do what your developer has done. i.e. generate the VO for the
ONE side of the relations ship.

Now, I want the XDoclet tag that will generate the VO for the MANY side with
a method that accepts the VO of the ONE side object.

i.e. the other side of the relationship of the code you sent.


TIA,

Kunal

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harkness,
David
Sent: Wednesday, 26 May 2004 06:29
To: [EMAIL PROTECTED]
Subject: RE: [Xdoclet-user] @ejb.value-object and CMR

[EMAIL PROTECTED] wrote:
> Note that I am successfully able to generate the VO for the
> relation on the "many" side (Dept) using the link you refer
> to in your response.

Excellent!

> However, I have a problem generating the VO for the object on
> the "one" side.

Do I understand you correctly that the Emp object correctly gets
accessors for get/setEmpVO() that include the DeptVO? From your previous
email I am thinking you mean Emp is the "many" side and Dept is the
"one" side. So now you need to have the DeptVO include a Collection/Set
of EmployeeVOs, right?

> Also, as per the doc, it suggests that the getXxxVO() should
> be abstract.
> 
> However, if I do declare an abstract getXxxVO(), I get the following
> exception: ==================================
> 14:54:21,984 ERROR [LogInterceptor] EJBException:
> javax.ejb.EJBException: Method is not a known CMP field
> accessor, CMR field accessor, or ejbSelect method:
> methodName=getDeptVO() ==================================
> 
> Are there any concrete examples you can forward?

Okay, I don't know precisely if the abstract VO methods are needed.
Looking at my co-worker's code, I only see some of them being declared
in the abstract beans. Here's a snippet of one bean, Campaign, that has
many Coupons. It is a bi-directional 1:N relation, but only the
CampaignVO has a Collection of CouponVOs.

  /**
   * @ejb.bean
   *      name="Campaign"
   *      type="CMP"
   *      cmp-version="2.x"
   *      primkey-field="id"
   *
   * @ejb.value-object
   *      name="Campaign"
   *      match="*"
   */
  public abstract class CampaignEJB implements EntityBean, Serializable
  {
    /**
     * @ejb.relation
     *      name="Campaign-Coupon"
     *      role-name="Campaign-has-many-Coupons"
     * @ejb.value-object
     *      type="Collection"
     *      aggregate="dd.ejb.entity.commerce.CouponValue"
     *      aggregate-name="Coupon"
     *      members="dd.ejb.entity.commerce.CouponLocal"
     *      members-name="Coupon"
     *      relation="external"
     */
    public abstract Collection getCoupons();
    public abstract void setCoupons(Collection coupons);
  }

I hope that helps you. Unfortunately, the code isn't as clean as it
could be (we never got time to refactor it), but I think you'll get the
gist.

David Harkness
Sr. Software Engineer
Sony Pictures Digital Networks
(310) 482-4756


-------------------------------------------------------
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_id149&alloc_id66&op=ick
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user





-------------------------------------------------------
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_id149&alloc_id66&op=click
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to