((JDBCDataSet)ds).setQuery(((SbiQueryDataSet)hibDataSet).getQuery());
SbiDataSource sbids=((SbiQueryDataSet)hibDataSet).getDataSource();
if(sbids!=null){
DataSourceDAOHibImpl dataSourceDao=new DataSourceDAOHibImpl();
IDataSource dataSource=dataSourceDao.toDataSource(sbids);
((JDBCDataSet)ds).setDataSource(dataSource);
}
ds.setDsType(DataSetConstants.QUERY);
}
if(hibDataSet instanceof SbiWSDataSet){
ds=new WebServiceDataSet();
((WebServiceDataSet)ds).setAddress(((SbiWSDataSet)hibDataSet).getAdress());
((WebServiceDataSet)ds).setOperation(((SbiWSDataSet)hibDataSet).getOperation());
ds.setDsType(DataSetConstants.WEB_SERVICE);
}
if(hibDataSet instanceof SbiScriptDataSet){
ds=new ScriptDataSet();
((ScriptDataSet)ds).setScript(((SbiScriptDataSet)hibDataSet).getScript());
((ScriptDataSet)ds).setLanguageScript(((SbiScriptDataSet)hibDataSet).getLanguageScript());
ds.setDsType(DataSetConstants.SCRIPT);
}
if(hibDataSet instanceof SbiJClassDataSet){
ds=new JavaClassDataSet();
((JavaClassDataSet)ds).setClassName(((SbiJClassDataSet)hibDataSet).getJavaClassName());
ds.setDsType(DataSetConstants.JAVA_CLASS);
}
if (hibDataSet instanceof SbiQbeDataSet) {
ds = new QbeDataSet();
SbiQbeDataSet aSbiQbeDataSet = (SbiQbeDataSet) hibDataSet;
QbeDataSet qbeDataset = (QbeDataSet) ds;
qbeDataset.setJsonQuery(aSbiQbeDataSet.getJsonQuery());
qbeDataset.setDatamarts(aSbiQbeDataSet.getDatamarts());
SbiDataSource sbids = aSbiQbeDataSet.getDataSource();
if (sbids!=null){
DataSourceDAOHibImpl dataSourceDao = new DataSourceDAOHibImpl();
IDataSource dataSource = dataSourceDao.toDataSource(sbids);
qbeDataset.setDataSource(dataSource);
}
ds.setDsType(DataSetConstants.QBE);
}