DatabaseMapping mapping = (DatabaseMapping)mappings.get(index);
mapping.writeFromObjectIntoRow(object, row, session);
}
}
public void addNamespaceDeclarations(Document document) {
NamespaceResolver namespaceResolver = getNamespaceResolver();
if (namespaceResolver == null) {
return;
}
Element docElement = document.getDocumentElement();
if(namespaceResolver.getDefaultNamespaceURI() != null) {
docElement.setAttributeNS(XMLConstants.XMLNS_URL, XMLConstants.XMLNS, namespaceResolver.getDefaultNamespaceURI());
}
Enumeration prefixes = namespaceResolver.getPrefixes();
String prefix;
String namespace;
while (prefixes.hasMoreElements()) {
prefix = (String)prefixes.nextElement();
namespace = namespaceResolver.resolveNamespacePrefix(prefix);
docElement.setAttributeNS(XMLConstants.XMLNS_URL, XMLConstants.XMLNS + ":" + prefix, namespace);
}
}