Hi Robert,

OJB can handle Maps already. please have a look at org.apache.ojb.odmg.collections.DMapImpl.
To use a DMap as a Map attribute in a persistent class just declare a reference-descriptor for the Mapp attribute.

Of course it's also possible to use your own Map implementations instead.
Did you have a look at the ManageableCollection concept already?
(See code in the package org.apache.ojb.broker.util.collections)
You can tell OJB to use your own user defined collections. SO it it would be possible to implement a Map that also implements the ManageableCollection interface.

(have a look at tutorial3.html, section "types allowed for implementing 1:n associations")

If you write a new persistent map I'm interested in including it in the code base!

cheers,
Thomas

Robert Ellis Parrott wrote:
Has there been any effort to allow the <collection-descriptor > setup in
basic OJB to handle Maps as well as Collections & Vectors? The general
idea I'm thinking of is that one could specifiy a field in the table that
contains the collection of objects to serve as a key (i.e. in our DB, each
table has a unique "ID" field to identify it).

It seems that it wouldn't involve too much effort, just a put(key,object)
instead of a add(object) ( and of course getting the key value, etc.)

If no one has done this sort of thing before, pointers to classes that
would need modified would be very welcome.


TIA,

rob



----------------------------
Robert E. Parrott
Department of Physics
351 Jefferson Laboratory
Harvard University
17 Oxford St.
Cambridge, Massachusetts 02138
(617)-495-2867
[EMAIL PROTECTED]
[EMAIL PROTECTED] (permanent)




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






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

Reply via email to