public static FeatureDataAccessProviders CreateDataAccessProviders(string path, bool deleteIfExists) { if (deleteIfExists) { var exists = File.Exists(path); if (exists) { File.Delete(path); } } try { NHibernateUtil.ConnectToDatabase(path, true); } catch (Exception ex) { throw ex; } IUmcDAO featureCache = new UmcDAOHibernate(); IUmcClusterDAO clusterCache = new UmcClusterDAOHibernate(); IMSFeatureDAO msFeatureCache = new MSFeatureDAOHibernate(); IMSnFeatureDAO msnFeatureCache = new MSnFeatureDAOHibernate(); IMsnFeatureToMSFeatureDAO msnMSCache = new MSnFeatureToMSFeatureDAOHibernate(); IDatasetDAO datasetCache = new DatasetDAOHibernate(); IMassTagDAO massTagCache = new MassTagDAOHibernate(); IMassTagMatchDAO massTagMatchCache = new MassTagMatchDAO(); ISequenceToMsnFeatureDAO sequenceMap = new SequenceToMsnDAOHibernate(); var providers = new FeatureDataAccessProviders(featureCache, clusterCache, msFeatureCache, msnFeatureCache, msnMSCache, datasetCache, massTagMatchCache, massTagCache, new FactorDAOHibernate(), new DatasetToFactorDAOHibernate(), new MSMSClusterMapClusterDAOHibernate(), new DatabaseSearchSequenceDAOHibernate(), sequenceMap) { ScanSummaryDao = new ScanSummaryDAOHibernate(), ScanSummaryProviderCache = new ScanSummaryProviderCache(), OptionsDao = new OptionsDAOHibernate(), }; return(providers); }
public static FeatureDataAccessProviders CreateDataAccessProviders(string path, bool deleteIfExists) { if (deleteIfExists) { var exists = File.Exists(path); if (exists) { File.Delete(path); } } try { NHibernateUtil.ConnectToDatabase(path, true); } catch (Exception ex) { throw ex; } IUmcDAO featureCache = new UmcDAOHibernate(); IUmcClusterDAO clusterCache = new UmcClusterDAOHibernate(); IMSFeatureDAO msFeatureCache = new MSFeatureDAOHibernate(); IMSnFeatureDAO msnFeatureCache = new MSnFeatureDAOHibernate(); IMsnFeatureToMSFeatureDAO msnMSCache = new MSnFeatureToMSFeatureDAOHibernate(); IDatasetDAO datasetCache = new DatasetDAOHibernate(); IMassTagDAO massTagCache = new MassTagDAOHibernate(); IMassTagMatchDAO massTagMatchCache = new MassTagMatchDAO(); ISequenceToMsnFeatureDAO sequenceMap = new SequenceToMsnDAOHibernate(); var providers = new FeatureDataAccessProviders(featureCache, clusterCache, msFeatureCache, msnFeatureCache, msnMSCache, datasetCache, massTagMatchCache, massTagCache, new FactorDAOHibernate(), new DatasetToFactorDAOHibernate(), new MSMSClusterMapClusterDAOHibernate(), new DatabaseSearchSequenceDAOHiberate(), sequenceMap); return providers; }