Hi Timothy, yes, there's the getPrimaryKey on the value objects, but as I can't tell which was the added one, it's not much use.
I think the comparator solution seems to be the only way to go. The problem with this is on the (very) small chance that the sequence generator can wrap around, it will fail to work! I was just wondering if there's a more robust way of doing this. thanks, Mark >-- Original Message -- >Subject: RE: [Xdoclet-user] pk of value object added to CMR collection >From: "COCKLE Timothy" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >Date: Fri, 27 Feb 2004 06:24:06 -0000 > > >Is there not a getPrimaryKey method? > >Assuming the PKs are generated in squance. You could write a Comparator >and search for the greatest PK using the Collections search methods. > > > >-----Original Message----- >From: Mark Stacey [mailto:[EMAIL PROTECTED] >Sent: Thu 26/02/2004 19:34 >To: [EMAIL PROTECTED] >Cc: >Subject: [Xdoclet-user] pk of value object added to CMR >collection >Hi, > >When adding a value object to a CMR field of another value object, is it >possible to figure out which was the newly created object? > >I basically need to know the primary key of the value object that was >just >created. So if you had a car value object, and you added a new wheel >value >object to it's collection of wheels, how can you retrieve that specific >instance to find the pk that was assigned, or any other DB assigned >ids/codes? > >thanks! > >Mark >Mark Stacey > >I'm using Vodafone Mail - to get your free mobile email account go to >http://www.vodafone.ie >Use of Vodafone Mail is subject to Terms and Conditions >http://www.vodafone.ie/terms/website > > > > > >------------------------------------------------------- >SF.Net is sponsored by: Speed Start Your Linux Apps Now. >Build and deploy apps & Web services for Linux with >a free DVD software kit from IBM. Click Now! >http://ads.osdn.com/?ad_id56&alloc_id438&op=ick >_______________________________________________ >xdoclet-user mailing list >[EMAIL PROTECTED] >https://lists.sourceforge.net/lists/listinfo/xdoclet-user > >The information in this email is confidential and is intended solely for >the addressee. Access to this email by anyone else is unauthorised. > >If you are not the intended recipient, any disclosure, copying, >distribution or any action taken or omitted to be taken in reliance on >it, except for the purpose of delivery to the addressee, is prohibited >and may be unlawful. Kindly notify the sender and delete the message and >any attachment from your computer. > >Attachment: winmail.dat > Mark Stacey I'm using Vodafone Mail - to get your free mobile email account go to http://www.vodafone.ie Use of Vodafone Mail is subject to Terms and Conditions http://www.vodafone.ie/terms/website ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=click _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
