Maksimenko Alexander wrote:
You shouldn't need to specify an extent-class from ABC to A as there is already one to AB which itself has one to A.
i'm using xdoclet. it automatically adds A to extents of ABC
Only if ABC directly inherits from A (which it doesn't have to).
Also, your collection-descriptor refers to a field parentId in 'class' ABC. Therefore you need to declare one there - this also applies to the interface itself, not only the descriptors in the repository.xml. The usual way of handling this is declaring getters/setters in the interface (the java one, not the descriptor) for all properties that you invoke on them (e.g. parentId in the foreignkey, ojbConcreteClass), and also declare them in the descriptor for the interface. Then you must use the PersistentFieldIntrospectorImpl or PersistentFieldAutoProxyImpl for the PersistentField setting since OJB can access the parentId only via bean-properties.
I can't do this because parentId is anonymous field.
I'm not sure that this can work. But you can try to specifiy the anonymous field in the ABC interface.
Now since OJB must be able to create new objects when reading the collection, you must tell it which concrete class is there. You can either handle this on your own (using factory-class/factory-method for the ABC interface) or you map the interfaces and concrete subclasses to one table (using ojbConcreteClass). Here I'm afraid, mapping to multiple tables does not work.I use ojbConcreteClass
Then declare getters/setters for it in the ABC interface and OJB should be able to create the correct instances.
Tom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
