Answer to [EMAIL PROTECTED] and Mick Knutson

I've been working with xdoclet for only three weeks, so i'm far to be a specialist.
I can give you the code to manage an value object for one to one and many to one relation, it seems to work fine, but i've not yet used a object value containing a one to many relation.

1-1 or n-1 relation:

/** @ejb.value-object
   *     relation="external"
   *    aggregate="TargetValue"   
   *     aggregate-name = "Target"
   *     members = "Target"
   *     members-name = "getValue"
*/

I don't know what happens if the target doesn't exist, perhaps a null pointer?


[EMAIL PROTECTED] wrote:
I am very happy you sent this an think this is very valuable to me.
I would also like to request your help in adding to this matrix below. Culd 
tell me how the valueObject attribute would be used for each of the 
variations of relationships please?



---
Thanks...
Mick Knutson
---





  
From: Jean-philippe VIGNIEL <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [Xdoclet-user] Pb with *:1 relationship (Thanks)
Date: Fri, 18 Jul 2003 09:08:31 +0200

Thanks very much for your help. Your solution is not very intuitive but It 
works:)
To resume the thread for the next person who needs for a n-1 relation.:

   1-1 relation:

         /**       @ejb.relation
          *     name = "Source-Target"
          *     role-name = "Source"
          *
          *     target-ejb = "Target"
          *     target-role-name = "Target"
          *   /
       public abstract Target getTarget();
       public abstract void setTarget(Target target)

1-n relation:


     /**       @ejb.relation
      *     name = "Source-Target"
      *     role-name = "Source"
      *
      *     target-ejb = "Target"
      *     target-role-name = "Target"
       *    targte-multiple = "yes"
      *   /
   public abstract Collection getTarget();
   public abstract void setTarget(Collection target)

And the n-1 relation which is not very logical:)


     /**       @ejb.relation
      *     name = "Source-Target"
      *     role-name = "Source"
      *
      *     target-ejb = "Target"
      *     target-role-name = "Target"
       *    target-multiple = "yes"
      *   /
   public abstract Target getTarget();
   public abstract void setTarget(Target target)




    

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user


  

Reply via email to