Search in sources :

Example 1 with MetricSubcategory

use of uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory in project miso-lims by miso-lims.

the class MetricDto method to.

public Metric to() {
    Metric to = new Metric();
    setLong(to::setId, getId(), false);
    setString(to::setAlias, getAlias());
    setObject(to::setCategory, getCategory(), MetricCategory::valueOf);
    setObject(to::setSubcategory, MetricSubcategory::new, getSubcategoryId());
    setObject(to::setThresholdType, getThresholdType(), ThresholdType::valueOf);
    setString(to::setUnits, getUnits());
    setInteger(to::setSortPriority, getSortPriority(), true);
    setObject(to::setNucleicAcidType, getNucleicAcidType(), NucleicAcidType::valueOf);
    setObject(to::setTissueMaterial, TissueMaterialImpl::new, getTissueMaterialId());
    setObject(to::setTissueType, TissueTypeImpl::new, getTissueTypeId());
    setBoolean(to::setNegateTissueType, isNegateTissueType(), false);
    setObject(to::setTissueOrigin, TissueOriginImpl::new, getTissueOriginId());
    setObject(to::setContainerModel, SequencingContainerModel::new, getContainerModelId());
    setInteger(to::setReadLength, getReadLength(), true);
    setInteger(to::setReadLength2, getReadLength2(), true);
    return to;
}
Also used : TissueMaterialImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) NucleicAcidType(uk.ac.bbsrc.tgac.miso.core.data.type.NucleicAcidType) TissueOriginImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueOriginImpl) Metric(uk.ac.bbsrc.tgac.miso.core.data.impl.Metric) TissueTypeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl) MetricSubcategory(uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory) MetricCategory(uk.ac.bbsrc.tgac.miso.core.data.type.MetricCategory) ThresholdType(uk.ac.bbsrc.tgac.miso.core.data.type.ThresholdType)

Example 2 with MetricSubcategory

use of uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory in project miso-lims by miso-lims.

the class MetricSubcategoryDto method to.

public MetricSubcategory to() {
    MetricSubcategory to = new MetricSubcategory();
    setLong(to::setId, getId(), false);
    setObject(to::setCategory, getCategory(), MetricCategory::valueOf);
    setString(to::setAlias, getAlias());
    setObject(to::setLibraryDesignCode, LibraryDesignCode::new, getLibraryDesignCodeId());
    setInteger(to::setSortPriority, getSortPriority(), true);
    return to;
}
Also used : LibraryDesignCode(uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode) MetricSubcategory(uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory) MetricCategory(uk.ac.bbsrc.tgac.miso.core.data.type.MetricCategory)

Example 3 with MetricSubcategory

use of uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory in project miso-lims by miso-lims.

the class HibernateMetricSubcategoryDaoIT method testGetByAliasAndCategory.

@Test
public void testGetByAliasAndCategory() throws Exception {
    final String alias = "Nucleic Acid Isolation";
    final MetricCategory category = MetricCategory.EXTRACTION;
    MetricSubcategory item = getTestSubject().getByAliasAndCategory(alias, category);
    assertNotNull(item);
    assertEquals(alias, item.getAlias());
    assertEquals(category, item.getCategory());
}
Also used : MetricSubcategory(uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory) MetricCategory(uk.ac.bbsrc.tgac.miso.core.data.type.MetricCategory) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest) Test(org.junit.Test)

Example 4 with MetricSubcategory

use of uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory in project miso-lims by miso-lims.

the class HibernateMetricSubcategoryDaoIT method testGetUsage.

@Test
public void testGetUsage() throws Exception {
    MetricSubcategory item = (MetricSubcategory) currentSession().get(MetricSubcategory.class, 3L);
    assertEquals(1L, getTestSubject().getUsage(item));
}
Also used : MetricSubcategory(uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest) Test(org.junit.Test)

Example 5 with MetricSubcategory

use of uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory in project miso-lims by miso-lims.

the class HibernateMetricSubcategoryDaoIT method getCreateItem.

@Override
public MetricSubcategory getCreateItem() {
    MetricSubcategory item = new MetricSubcategory();
    item.setAlias("New");
    item.setCategory(MetricCategory.FULL_DEPTH_SEQUENCING);
    return item;
}
Also used : MetricSubcategory(uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory)

Aggregations

MetricSubcategory (uk.ac.bbsrc.tgac.miso.core.data.impl.MetricSubcategory)5 MetricCategory (uk.ac.bbsrc.tgac.miso.core.data.type.MetricCategory)3 Test (org.junit.Test)2 AbstractHibernateSaveDaoTest (uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest)2 LibraryDesignCode (uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode)1 Metric (uk.ac.bbsrc.tgac.miso.core.data.impl.Metric)1 SequencingContainerModel (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel)1 TissueMaterialImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl)1 TissueOriginImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.TissueOriginImpl)1 TissueTypeImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl)1 NucleicAcidType (uk.ac.bbsrc.tgac.miso.core.data.type.NucleicAcidType)1 ThresholdType (uk.ac.bbsrc.tgac.miso.core.data.type.ThresholdType)1