On Tue, 6 Jan 2004, De Swert Pierre (GFDI) wrote:

> I am eagerly waiting the version of the XDoclet module supporting nested
> objects...
> The syntax looks very nice.
> 
> A question about the @ojb.modify-nested tag. Potentially, an object can
> embed many instances of the same class.
> For instance, a SimpleCustomer object can hold a billing and shipping
> address.
> A specific mapping attribute name - column name should be specified at
> the nesting class level.
> I would like to know if the @ojb.modify-nested tag will allow me specify
> an alternate column name to deal with multiple nested objects of the
> same class?
> 
> I would like to write things such as...
> 
>    /**
>      * @ojb.class table="SIMPLE_CUSTOMER"
>      */
>     public class SimpleCustomer implements java.io.Serializable
>     {
>         /**
>          * @ojb.nested
>          * @ojb.modify-nested name="streetName"
>          *                    column="SHIPPING_STREET_NAME"
>          * @ojb.modify-nested name="streetNumber"
>          *                    column="SHIPPING_STREET_NUMBER"
>          * @ojb.modify-nested name="zip"
>          *                    column="SHIPPING_ZIP_CODE"
>          */
>         protected Address shippingAddress;

This will be possible. Basically, the ojb.modify-nested tag will allow for
the same changes as the ojb.modfiy-inherited tag (they'll probably share
most of their implementation). So you an change almost all properties
(with some exceptions e.g. access for anonymous fields and
indirection-table for collections).

> 
>     // or better... :-)
>         /**
>          * @ojb.nested
>          * @ojb.modify-nested name="*"
>          *                    column="BILLING_*"
>          */
>         protected Address billingAddress;
>         /** @ojb.field column="NAME" */
>         protected String name;
>         ...
>     }

Don't expect something like this in the near future ;-(

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to