});
}
db.setDefaultProperties(loader.getContainer()); // done after loading config from XML Element
DataSourceAdapter adapter = source.getAdapter();
if (adapter == null)
{
return; // no RDBMS mapping defined for "optional" DataSource, hence no component required
}
final Component component =
new Component(source.getName(), adapter.getClassObject(), Component.CONTEXT);
component.setMetadata(loader.getMetadata());
if (element != null)
{
XMLUtil.withFirstChildElement(element, "SQLHook", false, new ElementHandler()
{
public void handleElement(Element componentElement)
{
Component hook = new Component("<SQLHook:" + source.getName() + ">");
m_loader.loadComponent(componentElement, hook);
component.addComponentPropertyInitializer("SQLHook", hook);
}
});
}
db.setComponent(component);
if (adapter.getVersion() != null)
{
component.addPrimitivePropertyInitializer("version", adapter.getVersion());
}
if (!db.isUnicode())
{
component.addPrimitivePropertyInitializer("unicode", Boolean.FALSE);