Re: Antwort: Re: [OJB-developers] ODMG question
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-06-11 18:44:23
|
Hi Joachim, Joa...@tp... wrote: > [snip updateing lists/collections] > >>tricky question. >>If you were using an ODMG collection like DList instead of a normal >>Vector or ArrayList, OJB would behave as expected and store the new > > entry. > >>The ODMG collections inform the current ODMG transaction about adding >>and removing of elements and do the locking for you. > > > So I only have to create the array with "implementation.newDList()" > instead of a "new ArrayList()", or do I have to change anything in the > mapping? > The collection Attribute must be typed as DList. So OJB will know that your collection attribute must be filled with on reloading from the database. If you don't want to change the collection attribute type to DList you can set the attribute collection-class="ojb.odmg.collections.DListImpl" of the class-descriptor element describing the collection. > >>As far as I remember this is compliant to the ODMG spec. It is not >>required to provide tranparent persistence for any Collection class but >>only for the ODMG collections. It's sometimes difficult to decide how >>certain features should be implemented as the spec for the Java language > > >>binding is not always precise (The JDO spec is much cleaner). >> >>Even commercial OODBMS ODMG Java Bindings differ quite a lot ! >> >>Of course it would be better to let our ODMG implementation handle this >>automatically for all kind of collections! >> >>This would require some kind of byte-code enhancement. Maybe we can >>reuse parts of the JDO byte-code enhancer to implement this feature. > > > I massively dislike any kind of byte-code enhancement, as it looks like > evil, black magic to me and I can't imagine that it can be debugged in a > sane manner. +1 ciao, Thomas |