On Sat, 7 Feb 2004, Gus Heck wrote:

> Interesting. is there an example of this somewhere? How would this work 
> with JDO? Can this table be generated as needed somehow? That would be 
> ideal. I would like my objects to simply use their collections as normal 
> java collections, otherwise, I have to go back and carefully analyze my 
> object model to find all the collections that each object might wind up in.

This table is generated by the xdoclet module, so in a sense it is
static. You can have a look at the second example of the ojb.collection
tag to see how a m:n collection is defined where the 'other' end has no
knowledge that it is part of an association.
 
> So does this mean I can only have collections of a specific element 
> type? What about collections that hold multiple types? Is it impossible 
> to store them? I think that specification of element types is supposed 
> to be optional for JDO. (allowing the implementation to optimize if it 
> is specified)

In normal OJB (PB, ODMG) you specify 1:n associations (references), 1:n
and m:n associations (colletions) between persistent classes (types that
have a class descriptor). If you want a somewhat generic collection you
have to find a common basetype of all possible element objects, which can
be made persistent. Especially it needs to have primary keys.
I don't know anything about JDO, but I guess it is the same there.

Tom



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

Reply via email to