RE: Copying DataObjects

From: Cris Daniluk (cris.danilu..laraview.com)
Date: Wed Mar 23 2005 - 17:44:37 EST

  • Next message: Mike Kienenberger: "Re: Firebird generators"

    Oops. Wrong template attached.

    > -----Original Message-----
    > From: Cris Daniluk [mailto:cris.danilu..laraview.com]
    > Sent: Wednesday, March 23, 2005 5:36 PM
    > To: cayenne-deve..bjectstyle.org
    > Subject: Copying DataObjects
    >
    > I've been thinking about posting this to the wiki, but not
    > sure if it would be valuable to anyone else.
    >
    > We frequently have a need to copy the properties of
    > DataObjects back and forth (either to other DataObjects, or
    > to beans further down the chain). BeanUtils is an obvious
    > choice, but unfortunately it takes properties from
    > CayenneDomainObject as well (specifically, the persistence
    > state). To solve that, I wrote a quick little version of
    > BeanUtils.copyProperties that only considers properties which
    > contain the..ersistent annotation. Attached are the files
    > necessary to make this work. Just make sure that the class
    > files are accessible when building your data objects. Then
    > use PersistentBeanUtils.copyProperties to copy only the
    > properties of the data object itself.
    >
    > Of course, this only works w/JDK 1.5...
    >
    > Cris
    >





    This archive was generated by hypermail 2.0.0 : Wed Mar 23 2005 - 17:44:35 EST