diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/AbstractDatasetLoader.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/AbstractDatasetLoader.java index da604dc960e67f4d03ef92433beeed67955fa991..ce76f5754973c47b1e1867965657ca7c0e211964 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/AbstractDatasetLoader.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/AbstractDatasetLoader.java @@ -21,6 +21,9 @@ import javax.sql.DataSource; import org.springframework.dao.DataAccessException; import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.GenericUtils; +import ch.systemsx.cisd.yeastx.db.generic.IGenericDAO; /** * Abstract class for dataset loaders. Provides commit and rollback functionality and creation of @@ -73,7 +76,7 @@ abstract public class AbstractDatasetLoader<T extends IGenericDAO> implements ID throw new IllegalStateException( "The previous transaction of uploading a dataset has been neither commited nor rollbacked."); } - DBUtils.createDataSet(getDao(), dataSet); + GenericUtils.createDataSet(getDao(), dataSet); isTransactionCompleted = false; } diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DBUtils.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DBUtils.java index 1c7b4a06d4edc212486cd1e357ae4bd0579b653a..598bc4081351bd17d1398a8f187438bdcc8f4bca 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DBUtils.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DBUtils.java @@ -71,81 +71,4 @@ public class DBUtils } } - /** - * Creates the data set based on the information given in <var>dataSet</var>. The sample and - * experiment of the data set may already exist in the database. If they don't, they are created - * as well.<br> - * Sets sample, experiment and dataset id fields of the specified dataset. - * <p> - * NOTE: Code responsible for trying to get sample and experiment from the DB and creating them - * if they don't exist is in synchronized block and uses currently opened transaction. Then the - * transaction is closed and data set is added to the DB in second transaction. If second - * transaction will be rolled back sample and experiment created in first transaction will stay - * in the DB. - */ - public static void createDataSet(IGenericDAO dao, DMDataSetDTO dataSet) - { - synchronized (IGenericDAO.class) - { - DMExperimentDTO experiment = getOrCreateExperiment(dao, dataSet); - dataSet.setExperimentId(experiment.getId()); // make sure all the ids are set correctly. - - if (dataSet.getSample() != null) - { - String permId = dataSet.getSample().getPermId(); - DMSampleDTO sample; - // it may have happened that the sample has been created by another thread after - // we checked that it does not exist - - sample = dao.getSampleByPermId(permId); - if (sample == null) - { - sample = dataSet.getSample(); - sample.setExperiment(experiment); - sample = createSample(dao, sample, permId); - } - - sample.setExperiment(experiment); - dataSet.setSample(sample); // make sure all the ids are set correctly. - } - dao.close(true); - } - - long dataSetId = dao.addDataSet(dataSet); - dataSet.setId(dataSetId); - } - - private static DMSampleDTO createSample(IGenericDAO dao, DMSampleDTO sample, String samplePermId) - { - final long sampleId = dao.addSample(sample); - sample.setId(sampleId); - return sample; - } - - private static DMExperimentDTO getOrCreateExperiment(IGenericDAO dao, DMDataSetDTO dataSet) - { - String permId = dataSet.getExperiment().getPermId(); - // it may have happened that the experiment has been created by another thread after - // we checked that it does not exist - synchronized (IGenericDAO.class) - { - DMExperimentDTO experiment = dao.getExperimentByPermId(permId); - if (experiment == null) - { - experiment = createExperiment(dao, dataSet, permId); - } - return experiment; - } - } - - private static DMExperimentDTO createExperiment(IGenericDAO dao, DMDataSetDTO dataSet, - String permId) - { - DMExperimentDTO experiment; - experiment = dataSet.getExperiment(); - long experimentId = dao.addExperiment(experiment); - experiment.setId(experimentId); - return experiment; - } - } diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/IDatasetLoader.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/IDatasetLoader.java index 1e1fd4d9edff58132c1e27d2a973ba83b165a68d..799c49eae919e6bfc0f2f62123a59010b6641a38 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/IDatasetLoader.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/IDatasetLoader.java @@ -19,6 +19,8 @@ package ch.systemsx.cisd.yeastx.db; import java.io.File; import java.sql.SQLException; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; + /** * @author Tomasz Pylak */ diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMDataSetDTO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMDataSetDTO.java similarity index 95% rename from rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMDataSetDTO.java rename to rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMDataSetDTO.java index dfb88d75743a84fe4f9533fe0f4cab8105f6a4a7..777097b59c28dec2b953d7f7cce04443d9e3de3c 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMDataSetDTO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMDataSetDTO.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.yeastx.db; +package ch.systemsx.cisd.yeastx.db.generic; import net.lemnik.eodsql.AutoGeneratedKeys; import net.lemnik.eodsql.ResultColumn; @@ -53,11 +53,13 @@ public class DMDataSetDTO String expePermId, String expeName) { this.permId = dsPermId; - final DMExperimentDTO experiment = new DMExperimentDTO(expePermId, expeName); + final DMExperimentDTO experiment = new DMExperimentDTO(expePermId); + experiment.setName(expeName); if (sampPermIdOrNull != null) { assert sampNameOrNull != null : "sample name must be given when sample permId is given"; - this.sampleOrNull = new DMSampleDTO(sampPermIdOrNull, sampNameOrNull); + this.sampleOrNull = new DMSampleDTO(sampPermIdOrNull); + sampleOrNull.setName(sampNameOrNull); sampleOrNull.setExperiment(experiment); } else { diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMExperimentDTO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMExperimentDTO.java similarity index 92% rename from rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMExperimentDTO.java rename to rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMExperimentDTO.java index 3df4cd07c4575e4c79c15a2a6cdacc18eb91d42b..340c4206540b4c086c5c224955a8c36a5464eb1f 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMExperimentDTO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMExperimentDTO.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.yeastx.db; +package ch.systemsx.cisd.yeastx.db.generic; import net.lemnik.eodsql.AutoGeneratedKeys; import net.lemnik.eodsql.ResultColumn; @@ -39,10 +39,9 @@ public class DMExperimentDTO // Bean compatibility. } - public DMExperimentDTO(String permId, String name) + public DMExperimentDTO(String permId) { this.permId = permId; - this.name = name; } public long getId() diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMSampleDTO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMSampleDTO.java similarity index 94% rename from rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMSampleDTO.java rename to rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMSampleDTO.java index e44efaa844d3a52da0234d4e24a2432a54a17298..25894dc005eedfd0a925f7360cf9316146a43e4c 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/DMSampleDTO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/DMSampleDTO.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.yeastx.db; +package ch.systemsx.cisd.yeastx.db.generic; import net.lemnik.eodsql.AutoGeneratedKeys; import net.lemnik.eodsql.ResultColumn; @@ -45,10 +45,9 @@ public class DMSampleDTO // Bean compatibility. } - public DMSampleDTO(String permId, String name) + public DMSampleDTO(String permId) { this.permId = permId; - this.name = name; } public long getId() diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/GenericUtils.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/GenericUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..0ead41406fc61e1df01b67d84fff03f17d55fa82 --- /dev/null +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/GenericUtils.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.yeastx.db.generic; + +/** + * @author Tomasz Pylak + */ +public class GenericUtils +{ + /** + * Creates the data set based on the information given in <var>dataSet</var>. The sample and + * experiment of the data set may already exist in the database. If they don't, they are created + * as well.<br> + * Sets sample, experiment and dataset id fields of the specified dataset. + * <p> + * NOTE: Code responsible for trying to get sample and experiment from the DB and creating them + * if they don't exist is in synchronized block and uses currently opened transaction. Then the + * transaction is closed and data set is added to the DB in second transaction. If second + * transaction will be rolled back sample and experiment created in first transaction will stay + * in the DB. + */ + public static void createDataSet(IGenericDAO dao, DMDataSetDTO dataSet) + { + synchronized (IGenericDAO.class) + { + DMExperimentDTO experiment = getOrCreateExperiment(dao, dataSet); + dataSet.setExperimentId(experiment.getId()); // make sure all the ids are set correctly. + + if (dataSet.getSample() != null) + { + String permId = dataSet.getSample().getPermId(); + DMSampleDTO sample; + // it may have happened that the sample has been created by another thread after + // we checked that it does not exist + + sample = dao.getSampleByPermId(permId); + if (sample == null) + { + sample = dataSet.getSample(); + sample.setExperiment(experiment); + sample = createSample(dao, sample, permId); + } + + sample.setExperiment(experiment); + dataSet.setSample(sample); // make sure all the ids are set correctly. + } + dao.close(true); + } + + long dataSetId = dao.addDataSet(dataSet); + dataSet.setId(dataSetId); + } + + private static DMSampleDTO createSample(IGenericDAO dao, DMSampleDTO sample, String samplePermId) + { + final long sampleId = dao.addSample(sample); + sample.setId(sampleId); + return sample; + } + + private static DMExperimentDTO getOrCreateExperiment(IGenericDAO dao, DMDataSetDTO dataSet) + { + String permId = dataSet.getExperiment().getPermId(); + // it may have happened that the experiment has been created by another thread after + // we checked that it does not exist + synchronized (IGenericDAO.class) + { + DMExperimentDTO experiment = dao.getExperimentByPermId(permId); + if (experiment == null) + { + experiment = createExperiment(dao, dataSet, permId); + } + return experiment; + } + } + + private static DMExperimentDTO createExperiment(IGenericDAO dao, DMDataSetDTO dataSet, + String permId) + { + DMExperimentDTO experiment; + experiment = dataSet.getExperiment(); + long experimentId = dao.addExperiment(experiment); + experiment.setId(experimentId); + return experiment; + } +} diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/IGenericDAO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/IGenericDAO.java similarity index 98% rename from rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/IGenericDAO.java rename to rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/IGenericDAO.java index 8e03104e266f530995c855217f7c98a7e08a54ad..63528310ea9377fe9151e367f3cfabdd3819b4e4 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/IGenericDAO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/db/generic/IGenericDAO.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package ch.systemsx.cisd.yeastx.db; +package ch.systemsx.cisd.yeastx.db.generic; import java.util.List; + import net.lemnik.eodsql.Select; import net.lemnik.eodsql.TransactionQuery; import net.lemnik.eodsql.Update; diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/EICML2Database.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/EICML2Database.java index 86441c7123f5bf79bafab4e1901b1fb2acfb4309..8d6eb6166deb241c5fc5b7bec84fa18e702ce291 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/EICML2Database.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/EICML2Database.java @@ -23,7 +23,7 @@ import java.util.List; import javax.sql.DataSource; import ch.systemsx.cisd.yeastx.db.AbstractDatasetLoader; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; import ch.systemsx.cisd.yeastx.eicml.EICMLParser.IChromatogramObserver; import ch.systemsx.cisd.yeastx.eicml.EICMLParser.IMSRunObserver; diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/IEICMSRunDAO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/IEICMSRunDAO.java index 7374352a3843ce43444821628fc48c56473dbb18..d20462cee5de1180173a52f57f3a12ba4091448b 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/IEICMSRunDAO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/eicml/IEICMSRunDAO.java @@ -20,7 +20,7 @@ import net.lemnik.eodsql.DataIterator; import net.lemnik.eodsql.Select; import net.lemnik.eodsql.Update; -import ch.systemsx.cisd.yeastx.db.IGenericDAO; +import ch.systemsx.cisd.yeastx.db.generic.IGenericDAO; /** * Interface for querying / updating the metabol database. diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/ML2DatabaseUploader.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/ML2DatabaseUploader.java index f3debfcbac1ad83c98753af146ea3819ed7abda5..45216aa01a2bb075671c77f572d9e0128345962f 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/ML2DatabaseUploader.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/ML2DatabaseUploader.java @@ -32,8 +32,8 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; import ch.systemsx.cisd.yeastx.db.IDatasetLoader; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; import ch.systemsx.cisd.yeastx.eicml.EICML2Database; import ch.systemsx.cisd.yeastx.fiaml.FIAML2Database; import ch.systemsx.cisd.yeastx.mzxml.MzXml2Database; diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/MLArchiverTask.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/MLArchiverTask.java index 7a0e3a8c3f4688f390a0f7156a6b8afabdb39c26..fded06e24ddb480990d68d95807bdfcaad690a1d 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/MLArchiverTask.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/MLArchiverTask.java @@ -32,7 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifi import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SpaceIdentifier; import ch.systemsx.cisd.yeastx.db.DBUtils; -import ch.systemsx.cisd.yeastx.db.IGenericDAO; +import ch.systemsx.cisd.yeastx.db.generic.IGenericDAO; /** * Archiver that removes/adds data related to given data set from/to metabol database. diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/FIAML2Database.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/FIAML2Database.java index 79246af8086c8143f3b38956ea154c8f8d283ee4..a98aa1961623c4cf0ee547960be11309dc62d992 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/FIAML2Database.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/FIAML2Database.java @@ -23,7 +23,7 @@ import java.util.Iterator; import javax.sql.DataSource; import ch.systemsx.cisd.yeastx.db.AbstractDatasetLoader; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; import ch.systemsx.cisd.yeastx.fiaml.FIAMLParser.IMSRunObserver; /** diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/IFIAMSRunDAO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/IFIAMSRunDAO.java index 26c302eea0037359a2700cd61cd350b9af8b96a0..93831612b50856b2bae5dcfb561b02aa315e6837 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/IFIAMSRunDAO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/fiaml/IFIAMSRunDAO.java @@ -20,7 +20,7 @@ import net.lemnik.eodsql.DataIterator; import net.lemnik.eodsql.Select; import net.lemnik.eodsql.Update; -import ch.systemsx.cisd.yeastx.db.IGenericDAO; +import ch.systemsx.cisd.yeastx.db.generic.IGenericDAO; /** * Interface for querying / updating the metabol database. diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/IMzXmlDAO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/IMzXmlDAO.java index 74809ffcc21fe7655cffbc6097e71c9b24940798..8d8e2e8ebac36fb16d8d710d94b3af16c88a5e5a 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/IMzXmlDAO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/IMzXmlDAO.java @@ -19,8 +19,8 @@ package ch.systemsx.cisd.yeastx.mzxml; import net.lemnik.eodsql.Select; import net.lemnik.eodsql.Update; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; -import ch.systemsx.cisd.yeastx.db.IGenericDAO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.IGenericDAO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzInstrumentDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzPrecursorDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzScanDTO; diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2Database.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2Database.java index 773f3870a3f1d0b6e77020bb4bff6404d953524d..9af38d4413eca486f4e511eebe7543041cf44ed6 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2Database.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2Database.java @@ -27,7 +27,7 @@ import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.exceptions.NotImplementedException; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.yeastx.db.AbstractDatasetLoader; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzPrecursorDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzRunDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzScanDTO; diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/IQuantMSDAO.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/IQuantMSDAO.java index e03ddcf1fe0a313bd2e67907ee16888b7fea15f0..522a5e2305cc3a72146c632d2177f369226bf036 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/IQuantMSDAO.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/IQuantMSDAO.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.yeastx.quant; import net.lemnik.eodsql.Select; import net.lemnik.eodsql.Update; -import ch.systemsx.cisd.yeastx.db.IGenericDAO; +import ch.systemsx.cisd.yeastx.db.generic.IGenericDAO; import ch.systemsx.cisd.yeastx.quant.dto.MSConcentrationDTO; import ch.systemsx.cisd.yeastx.quant.dto.MSQuantificationDTO; diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/QuantML2Database.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/QuantML2Database.java index fda48a38ce42fc5d59cb68293b7663a1e7766024..ac6b783778b82b88809568fd17052575a8eb71e1 100644 --- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/QuantML2Database.java +++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/quant/QuantML2Database.java @@ -23,7 +23,7 @@ import java.util.List; import javax.sql.DataSource; import ch.systemsx.cisd.yeastx.db.AbstractDatasetLoader; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; import ch.systemsx.cisd.yeastx.quant.dto.ConcentrationCompounds; import ch.systemsx.cisd.yeastx.quant.dto.MSConcentrationDTO; import ch.systemsx.cisd.yeastx.quant.dto.MSQuantificationDTO; diff --git a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/eicml/EICMLTest.java b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/eicml/EICMLTest.java index 3e6af129b797efcec8db6cb66f114e913c09a0ae..fbae0e68946dcb75ee8d95ab5f086cb6f34c9b68 100644 --- a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/eicml/EICMLTest.java +++ b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/eicml/EICMLTest.java @@ -32,7 +32,7 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.yeastx.db.AbstractDBTest; import ch.systemsx.cisd.yeastx.db.DBUtils; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; /** * A test for thhe eicML tables. diff --git a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/fiaml/FIAMLTest.java b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/fiaml/FIAMLTest.java index 559d12316258ae46a794026c7c3fb35fd060ee84..7f53610483af0610205c83d8616107fcb437b399 100644 --- a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/fiaml/FIAMLTest.java +++ b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/fiaml/FIAMLTest.java @@ -31,7 +31,8 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.yeastx.db.AbstractDBTest; import ch.systemsx.cisd.yeastx.db.DBUtils; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.GenericUtils; /** * A test for the fiaML tables. @@ -114,10 +115,10 @@ public class FIAMLTest extends AbstractDBTest { try { - DBUtils.createDataSet(fiamsDAO, new DMDataSetDTO("data set perm id 4", + GenericUtils.createDataSet(fiamsDAO, new DMDataSetDTO("data set perm id 4", "sample perm id4", "sample name", "experiment perm id", "experiment name")); // This will fail with a DataIntegrityViolationException. - DBUtils.createDataSet(fiamsDAO, new DMDataSetDTO("data set perm id 4", + GenericUtils.createDataSet(fiamsDAO, new DMDataSetDTO("data set perm id 4", "sample perm id4", "sample name", "experiment perm id", "experiment name")); // There is transaction commit inside createDataSet method before DS is added to DB. // DS created in first invocation will be be commited in second invocation. diff --git a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2DatabaseTest.java b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2DatabaseTest.java index 6837a6cf9c7ca94b116fd7b423141f83e1f6cbac..6b6f24028c9bf48b498d1e463c554398d12c0246 100644 --- a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2DatabaseTest.java +++ b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXml2DatabaseTest.java @@ -30,7 +30,7 @@ import org.testng.annotations.Test; import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.base.convert.NativeData; import ch.systemsx.cisd.base.convert.NativeData.ByteOrder; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzInstrumentDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzPeaksDTO; import ch.systemsx.cisd.yeastx.mzxml.dto.MzPrecursorDTO; diff --git a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXmlDAOTest.java b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXmlDAOTest.java index d3f6c0b3cd1e4bd431716d6178ec5e4607a8b452..1a6ce0bad34f9e0e8ac78a5931a258dfee4f7e25 100644 --- a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXmlDAOTest.java +++ b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/mzxml/MzXmlDAOTest.java @@ -25,7 +25,7 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.yeastx.db.AbstractDBTest; import ch.systemsx.cisd.yeastx.db.DBUtils; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; /** * @author Tomasz Pylak diff --git a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/quant/QuantMSDAOTest.java b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/quant/QuantMSDAOTest.java index 7ef67e5b061d01ee16f15b588698b18d4b2dc18b..469b1ff9d8908b640e2d7f20c1b2fe55e70dbf22 100644 --- a/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/quant/QuantMSDAOTest.java +++ b/rtd_yeastx/sourceTest/java/ch/systemsx/cisd/yeastx/quant/QuantMSDAOTest.java @@ -25,7 +25,7 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.yeastx.db.AbstractDBTest; import ch.systemsx.cisd.yeastx.db.DBUtils; -import ch.systemsx.cisd.yeastx.db.DMDataSetDTO; +import ch.systemsx.cisd.yeastx.db.generic.DMDataSetDTO; /** * @author Tomasz Pylak