Hi, While constructing the collection metadata, we try to get the package name. The top of the stack contains the property in which the collection element is defined. Property extends field so we look for the class metadata to get the package metadata. But the field metadata doesn't know that it can be in an interface; it only knows about being in a class or embedded metadata. An interface does know its package, so it's possible for the interface metadata to return the package, but an interface is an AbstractClass whereas the getClassMetadata method returns ClassMetadata. Possibilities: you could redefine getClassMetadata to return AbstractClassMetadata or have InterfaceMetadata inherit ClassMetadata. Also, looking at the JPOX implementation of startElement and it appears that it's not supported for an element "property" to be part of element "class". Shouldn't there be an else if (parent instanceof ClassMetaData) clause here? // New property for this interface else if (qName.equals("property")) { MetaData parent = getStack(); if (parent instanceof InterfaceMetaData) { InterfaceMetaData intmd = (InterfaceMetaData)parent; PropertyMetaData propmd = newPropertyObject(intmd, attrs); intmd.addProperty(propmd); pushStack(propmd); } else if (parent instanceof EmbeddedMetaData) { EmbeddedMetaData emd = (EmbeddedMetaData)parent; PropertyMetaData propmd = newPropertyObject(emd, attrs); emd.addProperty(propmd); pushStack(propmd); } Hope this helps. Craig Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp! |
smime.p7s
Description: S/MIME cryptographic signature
