Re: Value Object, serialization, state: hollow

From: Mike Kienenberger (mkienen..laska.net)
Date: Thu Feb 24 2005 - 22:16:47 EST

  • Next message: Mike Kienenberger: "Re: Synchronization/Deadlock"

    Andrew Reed <andrew.ree..ut.ac.nz> wrote:
    > I would like to know if there is a way of taking a CayenneDataObject
    > and transforming it into a "Value Object".

    If by value object, you mean a set of key-value pairs, just cycle through
    the DataObject's value Map, and copy all of those values to another Map or
    bean. BeanUtils.copyProperties(dataObject, valueObject)?

    Just be sure that you're prepared to handle relationship values in addition
    to the primitive types and their wrapped versions.

    If you're transfering objects, you're probably not transfering the whole
    object graph anyway.

    -Mike



    This archive was generated by hypermail 2.0.0 : Thu Feb 24 2005 - 22:16:09 EST