Hi Arvin, I see your problem now. I've never tried to do this directly with xdoclet before, because I've just called a getValueObject method on the actual local bean.
I think this goes beyond my expertise! Best of luck, Brian -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arvin Arora Sent: 03 July 2003 12:19 To: [EMAIL PROTECTED] Subject: AW: [Xdoclet-user] 1-N bidrectional visibility on value objects Hi Brian ! Here is the relation part of my Customer definition: /** * Defines the relation to 0..N projects. * * @ejb.relation * name="Customer-Projects" * role-name="customer-has-projects" * * @ejb.value-object * compose="neo.pps.model.projects.ProjectValue" * compose-name="ProjectValue" * members="neo.pps.model.projects.ProjectLocal" * members-name="Project" * relation="external" * type="Collection" * * @ejb.interface-method view-type="local" */ public abstract Collection getProjects(); /** * * @ejb.interface-method view-type="local" */ public abstract void setProjects(Collection projects); /** * * @ejb.interface-method */ public abstract CustomerValue getCustomerValue(); /** * * @ejb.interface-method */ public abstract void setCustomerValue(CustomerValue value); And here is the corresponding part of my Project Bean: /** * Defines the relation to 1 customer. * * @ejb.relation * name="Customer-Projects" * role-name="project-belongs-to-one-customer" * cascade-delete="yes" * * @jboss.relation * fk-constraint="true" * fk-column="customerNumber" * related-pk-field="number" * * @ejb.interface-method view-type="local" */ public abstract CustomerLocal getCustomer(); /** * * @ejb.interface-method view-type="local" */ public abstract void setCustomer(CustomerLocal customer); Which works fine up to the part where I want to have access to the Customer Value from the Project Value object. I get all kind of methods generated on the Customer and the Customer Value to handle projects - works. But I did not find a way to let xdoclet generate accessors for the Customer - btw: I tried to use the same definition ("ejb.value-object compose ...") on the Project Bean side. I did not expect this to work, because from Project Bean perspective it is not a composition - and actually it did not work. Also the get / set CustomerLocal methods shown above should not work as there is no connection to the customerNumber specified...?! Anyway xdoclet does not create the corresponding get / set CustomerValue methods on the Project Value object... Greetings Arvin NEO Business Partners GmbH FON +49 (0) 511 123 549 - 0 FAX +49 (0) 511 123 549 - 49 Mobil +49 (0) 172 51 56 300 eMail: mailto:[EMAIL PROTECTED] Website: http://www.NEO-Partners.com -----Urspr�ngliche Nachricht----- Von: Brian McSweeney [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 3. Juli 2003 12:33 An: [EMAIL PROTECTED] Betreff: RE: [Xdoclet-user] 1-N bidrectional visibility on value objects Hi Arvin, I presume you would just do the opposite on the other end of the relationship. Why don't you just add a compose tag to the AccountValue object which contains a UserValue object. Perhaps I'm not understanding the problem :-) Brian PS - would be interested in seeing the xdoclet tags you use to get many-value Objects from a single value object, ie customer-has-many-products. (PS - I'd say the same about your company, but I don't speak German :-) ) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arvin Arora Sent: 03 July 2003 11:09 To: [EMAIL PROTECTED] Subject: AW: [Xdoclet-user] 1-N bidrectional visibility on value objects Hi Brian ! Actually my problem arises on the other end of the relation: How do I get the UserValue from a Account Value object? In my sample "customer-has-many-projects" (using a bidirectional relation definition - not target ejb ...) I mastered to getProjectValues from CustomerValue but not the other way round. (BTW: Interesting stuff your company is doing...) Greetings Arvin NEO Business Partners GmbH FON +49 (0) 511 123 549 - 0 FAX +49 (0) 511 123 549 - 49 Mobil +49 (0) 172 51 56 300 eMail: mailto:[EMAIL PROTECTED] Website: http://www.NEO-Partners.com -----Urspr�ngliche Nachricht----- Von: Brian McSweeney [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 3. Juli 2003 11:47 An: [EMAIL PROTECTED] Betreff: RE: [Xdoclet-user] 1-N bidrectional visibility on value objects Hi Arvin, I'm not sure what you mean. If you look at the CustomerEJB there is a Section * @ejb.relation * name="customer-account" * role-name="customer-has-account" * target-ejb="Account" * target-role-name="account-belongs_to-customer" * target-cascade-delete="yes" * @ejb.value-object * compose="xpetstore.domain.signon.model.AccountValue" * compose-name="AccountValue" * members="xpetstore.domain.signon.interfaces.Account" * members-name="AccountValue" * relation="external" which shows that the CustomerValue object is composed of an AccountValue. This means there is a getAccountValue method from within the CustomerValue. Is this not what you wanted? Brian -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arvin Arora Sent: 03 July 2003 10:33 To: [EMAIL PROTECTED] Subject: AW: [Xdoclet-user] 1-N bidrectional visibility on value objects Hi Brian ! Thanks for the hint - I checked this out... BUT: The sample uses an unidirectional Xdoclet relation definition and additionally handles an userID in the Account Object with normal getter / setter - which obviously has to be handled seperately by the controller. This means that the actual CMR mechanisms is only used one way... Perhaps this means that there is no solution in the sense I requested and the sample is a respective workaround? Greetings Arvin NEO Business Partners GmbH FON +49 (0) 511 123 549 - 0 FAX +49 (0) 511 123 549 - 49 Mobil +49 (0) 172 51 56 300 eMail: mailto:[EMAIL PROTECTED] Website: http://www.NEO-Partners.com -----Urspr�ngliche Nachricht----- Von: Brian McSweeney [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 3. Juli 2003 11:11 An: [EMAIL PROTECTED] Betreff: RE: [Xdoclet-user] 1-N bidrectional visibility on value objects Hi Arvin, I think this is available in the xpetstore project At xpetstore.sourceforge.net. Check out the relationship between customer and account. Hth, Brian -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arvin Arora Sent: 03 July 2003 08:46 To: [EMAIL PROTECTED] Subject: [Xdoclet-user] 1-N bidrectional visibility on value objects Hi all ! I learned to appreciate Xdoclet to create J2EE prototypes without beeing a real J2EE programmer - I mastered most of the CMP etc. stuff - but one core thing I was not able to solve yet in spite of trying different approaches: Has somebody got a working Xdoclet sample for a 1-N relation (e.g. customer-has-many-projects) with value objects where the N-value object provides getter / setter (or at least getter) for the 1-value object? Thanks and Greetings Arvin NEO Business Partners GmbH FON +49 (0) 511 123 549 - 0 FAX +49 (0) 511 123 549 - 49 Mobil +49 (0) 172 51 56 300 eMail: mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Website: http://www.NEO-Partners.com <http://www.neo-partners.com/> ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
