On Fri, Sep 14, 2001 at 10:48:11AM +0200, marie sauvaud wrote:
> Hello,
>
> It is possible via Castor to map a 1-many relationship
> with a collection. But is it possible for the
> contained object to keep a reference on the container
> object?
> Example:
>
> If a house is made with several rooms, can the room
> keep a reference on the house?
Yes.
See src/examples/myapp/Product.java and src/examples/myapp/ProductDetail.java
Product 1 <----------------> n ProductDetail
^ this arrow-head is, what you want, and it is implemented in the
example
Especially in Product.java look at:
public void addDetail( ProductDetail detail )
{
_details.add( detail );
detail.setProduct( this );
}
Admittedly there seem to be some bugs in the current Castor version
(according to several messages on this list and to what I experience, too)
so I do not know, if it really works.
--
Holger Krug
[EMAIL PROTECTED]
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev