The cloneable contract requires that the resultant object is equal to the
base object (and thus that the hashCodes are equal as well). This could lead
to a lot of awkward situations considering Cayenne's design, so Cloneable
probably would not work.
> -----Original Message-----
> From: Jürgen Saar [mailto:jsaa..eb.de]
> Sent: Tuesday, December 28, 2004 11:11 AM
> To: cayenne-use..bjectstyle.org
> Subject: Re: Copy a DataObject
>
> I would prefer to implement cloneable
> and then go on like Mike
>
> Mike Kienenberger <mkienen..laska.net> schrieb am 28.12.04 16:28:40:
> >
> > Dave <sanxion200..ahoo.com> wrote:
> > > Are there any built in methods to create a copy of a
> DataObject? I
> > > want to add a new row that is the same as a prior. The
> key would be
> > > the only difference.
> >
> > I think you could do it by iterating through the "values" protected
> > DataObject map.
> >
> > Create a new object.
> > Iterate through values.
> > value = readProperty(key)
> > writeProperty(key, values)
> >
> > You might find that readPropertyDirectly and writePropertyDirectly
> > will work better for you.
> >
> > Supporting something like this in DataObjectUtils would be
> useful, so
> > you could submit an enhancement request (and probably a
> patch) in the
> > Jira issue tracker to get it into a future version of Cayenne.
> >
> > -Mike
>
>
> ________________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193
>
>
This archive was generated by hypermail 2.0.0 : Tue Dec 28 2004 - 17:54:33 EST