dataDomain.getEntityResolver().applyDBLayerDefaults();
dataDomain.getEntityResolver().applyObjectLayerDefaults();
for (DataNodeDescriptor nodeDescriptor : descriptor.getNodeDescriptors()) {
DataNode dataNode = new DataNode(nodeDescriptor.getName());
dataNode.setJdbcEventLogger(jdbcEventLogger);
dataNode.setDataSourceLocation(nodeDescriptor.getParameters());
DataSource dataSource = dataSourceFactory.getDataSource(nodeDescriptor);
dataNode.setDataSourceFactory(nodeDescriptor.getDataSourceFactoryType());
dataNode.setDataSource(dataSource);
// schema update strategy
String schemaUpdateStrategyType = nodeDescriptor
.getSchemaUpdateStrategyType();
if (schemaUpdateStrategyType == null) {
dataNode.setSchemaUpdateStrategy(defaultSchemaUpdateStrategy);
dataNode.setSchemaUpdateStrategyName(defaultSchemaUpdateStrategy
.getClass()
.getName());
}
else {
SchemaUpdateStrategy strategy = objectFactory.newInstance(
SchemaUpdateStrategy.class,
schemaUpdateStrategyType);
dataNode.setSchemaUpdateStrategyName(schemaUpdateStrategyType);
dataNode.setSchemaUpdateStrategy(strategy);
}
// DbAdapter
dataNode.setAdapter(adapterFactory.createAdapter(nodeDescriptor, dataSource));
// DataMaps
for (String dataMapName : nodeDescriptor.getDataMapNames()) {
dataNode.addDataMap(dataDomain.getDataMap(dataMapName));
}
dataDomain.addNode(dataNode);
}