use of org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaModel in project dbeaver by serge-rider.
the class GenericDataSourceProvider method openDataSource.
@NotNull
@Override
public DBPDataSource openDataSource(@NotNull DBRProgressMonitor monitor, @NotNull DBPDataSourceContainer container) throws DBException {
GenericMetaModelDescriptor metaModel = null;
Object metaModelId = container.getDriver().getDriverParameter(GenericConstants.PARAM_META_MODEL);
if (metaModelId != null && !GenericConstants.META_MODEL_STANDARD.equals(metaModelId)) {
metaModel = metaModels.get(metaModelId.toString());
if (metaModel == null) {
log.warn("Meta model '" + metaModelId + "' not recognized. Default one will be used");
}
}
if (metaModel == null) {
// Try to get model by driver class
metaModel = metaModels.get(container.getDriver().getDriverClassName());
}
if (metaModel == null) {
metaModel = getStandardMetaModel();
}
GenericMetaModel metaModelInstance = metaModel.getInstance();
return metaModelInstance.createDataSource(monitor, container);
}
Aggregations