> Adding my own Collection impl. (inheriting from EMF and implementing the > required ojb interface) is not possible because the type of the > collection is not known until runtime and the EMF collection classes do > not have empty constructors (see below).
But if I look at the code snippet you provided, I see that the used collection type is EObjectContainmentEList and its usage is fixed (i.e. specified in the class and instantiated via new). Now if you can configure the class that EMF puts there, then you can use your own OJB-adapted implementations, e.g. OjbEObjectContainmentEList ? > I try to build a generic integration between emf and ojb so that classes > generated by emf are persistable using ojb with no additional hand > coding. EMF does not generate a set method for collection members. The > collection can be retrieved using the get method and adapted directly. > This I think is a clean approach of EMF. > > As mentioned I made a small change (5-6 lines) to the retrieveCollection > method of ojb QueryReferenceBroker to get this working for me but I do > not want to keep my own copy of this class. Is there a possibility to > send this as a patch or let this be reviewed (just trying :-). Sure, just send it to the dev list. But please make sure that the unit tests pass as before. > However, I nicer approach than I implemented would work with collection > factories or so. > > Are there any ideas to make the QueryReferenceBroker/collection creation > more pluggable which I can work with? > I am also willing to try things out or code myself if this would help > out here. Mhmm, the main problem is that OJB sets its own collection types in order to maintain information about which sub-objects need to be persisted and so on. You should have a look at the usage of ManageableCollection to see what OJB does with collections. Also you might want to have a look at the query customizer functionality; for both you'll find some documentation in this and the next paragraph here: http://db.apache.org/ojb/docu/guides/advanced-technique.html#manageable-collection Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
