Hi David!

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.

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

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?


TIA,

Kunal

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harkness,
David
Sent: Tuesday, 25 May 2004 11:32
To: [EMAIL PROTECTED]
Subject: RE: [Xdoclet-user] @ejb.value-object and CMR

[EMAIL PROTECTED] wrote:
> I am attempting to create a value object for an object on the "1"
> side of the relationship. 
> 
> Example: DEPT-has-many-EMPs and EMP-belongs-to-one-DEPT
> 
> I want the the EmployeeVO to have a method with the following
> signature: public DepartmentVO getDepartment()
> 
> However, the value-object generated is as follows
> public Department getDepartment()

You should start by reading the Value Object documentation at

  http://xdoclet.sourceforge.net/xdoclet/valueobjects.html

You'll need to add several tags to get the relation inside the VO as
well.

> Here are the Xdoclet comments that I am using:
> 
> ===============================
> /**
>  * Get the department
>  *
>  * @ejb.interface-method
>  *
>  * @ejb.relation
>  *            name="employee-department"
>  *            role-name="employee-department:employee"
>  *
>  * @ejb.value-object
>  *
>  * @jboss.relation
>  *            fk-constraint = "true"
>  *            fk-column = "DEPARTMENT_FK"
>  *            related-pk-field = "id"
>  *
>  */
> public abstract Department getDepartment();

The tags you'll need include (I think):

  members
  members-name
  aggregate (or compose)
  aggregate-name
  relation="external" as it's a relation

It talks about specifying the return type of the collection (Collection
or Set). I assume that you simply don't specify the type since it's the
VO and not a collection, but I'm not entirely sure.

Finally, you need to add an abstract method for getting the Vos:

  public abstract DepartmentVO getDepartmentVO();

You should tag it as interface-method, IIRC. You probably need to
declare the setDepartmentVO as well. Hopefully this will get you
started.

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