You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Robert Coup <rc...@ec.auckland.ac.nz> on 2003/12/10 21:37:19 UTC

OMDG Collection Classes

Hi all,

What is the preferred way to use collections with the ODMG API. As I understand
it, you can use:

DList - which persists itself and all its entries separately meaning foreign
keys, etc. are all 'duplicated' (sort of) in the OJB_DLIST* tables. If you
create a DList for non-persistence purposes it stores it in the db tables
anyway. If you add a not-already-persisted object to a DList, it automagically
persists it for you.

ManageableCollection - removes FKs when objects are removed from a collection,
but  doesn't persist new objects when you add them to a persistent collection -
you need to use db.makePersistent().

Neither of these will delete (un-persist) objects when they are removed from a
collection.

Currently we've subclassed ManageableCollection to use for a variety of
collections (both persistent and non-persistent). We've very simply implemented
all the OJB methods except ojbAfterStore() which is empty. Could I adapt our
class to have the behaviour of DList with respect to adding objects, without the
additional-table stuff? Or is there another type of collection which works
perfectly well for what I want to do?

Thanks,

Robert Coup


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org