Keith,
Keith Visco wrote:
You should be able to implement an org.exolab.castor.xml.IDResolver and pass it off to the Unmarshaller. When the Unmarshaller encounters and ID that it doesn't know how to resolve, it will ask the registered IDResolver to handle the resolution.
thanks for this info!
I tried to follow this route, but found a problem. the org.exolab.castor.xml.IDResolver interface only has one method with the signature:
public Object resolve(String arg0);
i only get the id without any additional information. e.g. i do not know of which type is the object with the id arg0? in my database the ids are only unique within a given table, but not throughout the whole database.
for now i solved the problem by patching castor and extending the resolve method to the following signature:
public Object resolve(String arg0, XMLFieldDescriptor descriptor, Object parent);
via the descriptor.getFieldType() i get the necessary type information and i can implement the resolver:
Integer id = new Integer(Integer.parseInt(arg0));
result = db.load(descriptor.getFieldType(), id);
obviously i would prefer a solution where i can use the plain vanilla castor framework without any patches. i would appreciate any advice on this topic.
thanks, -- Christian Schuhegger http://www.el-chef.de/
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
