Search in sources :

Example 1 with Workstation

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

the class Dtos method to.

public static Instrument to(@Nonnull InstrumentDto dto) {
    Instrument to = new InstrumentImpl();
    setLong(to::setId, dto.getId(), false);
    setDate(to::setDateCommissioned, dto.getDateCommissioned());
    setDate(to::setDateDecommissioned, dto.getDateDecommissioned());
    setString(to::setName, dto.getName());
    setObject(to::setInstrumentModel, InstrumentModel::new, dto.getInstrumentModelId());
    setString(to::setSerialNumber, dto.getSerialNumber());
    setObject(to::setUpgradedInstrument, InstrumentImpl::new, dto.getUpgradedInstrumentId());
    setObject(to::setDefaultRunPurpose, RunPurpose::new, dto.getDefaultRunPurposeId());
    setString(to::setIdentificationBarcode, dto.getIdentificationBarcode());
    setObject(to::setWorkstation, Workstation::new, dto.getWorkstationId());
    return to;
}
Also used : Workstation(uk.ac.bbsrc.tgac.miso.core.data.Workstation) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) InstrumentImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl) Instrument(uk.ac.bbsrc.tgac.miso.core.data.Instrument) InstrumentModel(uk.ac.bbsrc.tgac.miso.core.data.InstrumentModel) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)

Example 2 with Workstation

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

the class HibernateWorkstationDaoIT method testCreate.

@Test
public void testCreate() throws IOException {
    String alias = "New Workstation";
    Workstation workstation = new Workstation();
    workstation.setAlias(alias);
    long savedId = sut.create(workstation);
    clearSession();
    Workstation saved = (Workstation) getSessionFactory().getCurrentSession().get(Workstation.class, savedId);
    assertNotNull(saved);
    assertEquals(alias, saved.getAlias());
}
Also used : Workstation(uk.ac.bbsrc.tgac.miso.core.data.Workstation) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 3 with Workstation

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

the class Dtos method to.

public static Workstation to(@Nonnull WorkstationDto from) {
    Workstation to = new Workstation();
    setLong(to::setId, from.getId(), false);
    setString(to::setAlias, from.getAlias());
    setString(to::setDescription, from.getDescription());
    setString(to::setIdentificationBarcode, from.getIdentificationBarcode());
    return to;
}
Also used : Workstation(uk.ac.bbsrc.tgac.miso.core.data.Workstation) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)

Example 4 with Workstation

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

the class Dtos method to.

public static Library to(@Nonnull LibraryDto from) {
    Library to = null;
    if (from instanceof DetailedLibraryDto) {
        to = toDetailedLibrary((DetailedLibraryDto) from);
    } else {
        to = new LibraryImpl();
    }
    if (from.getId() != null)
        to.setId(from.getId());
    to.setAlias(from.getAlias());
    to.setName(from.getName());
    to.setDescription(from.getDescription());
    to.setIdentificationBarcode(from.getIdentificationBarcode());
    setBigDecimal(to::setConcentration, from.getConcentration());
    to.setConcentrationUnits(from.getConcentrationUnits());
    to.setLowQuality(from.getLowQuality());
    if (from.getPaired() != null) {
        to.setPaired(from.getPaired());
    }
    to.setPlatformType(PlatformType.get(from.getPlatformType()));
    if (from.getParentSampleId() != null) {
        to.setSample(new SampleImpl());
        to.getSample().setId(from.getParentSampleId());
    }
    setObject(to::setLibrarySelectionType, LibrarySelectionType::new, from.getLibrarySelectionTypeId());
    if (from.getLibraryStrategyTypeId() != null) {
        LibraryStrategyType strat = new LibraryStrategyType();
        strat.setId(from.getLibraryStrategyTypeId());
        to.setLibraryStrategyType(strat);
    }
    if (from.getLibraryTypeId() != null) {
        LibraryType type = new LibraryType();
        type.setId(from.getLibraryTypeId());
        if (from.getLibraryTypeAlias() != null)
            type.setDescription(from.getLibraryTypeAlias());
        to.setLibraryType(type);
    }
    setObject(to::setDetailedQcStatus, DetailedQcStatusImpl::new, from.getDetailedQcStatusId());
    setString(to::setDetailedQcStatusNote, from.getDetailedQcStatusNote());
    if (from.getIndex1Id() != null) {
        Index tb1 = new Index();
        tb1.setId(from.getIndex1Id());
        to.setIndex1(tb1);
        if (from.getIndex2Id() != null) {
            Index tb2 = new Index();
            tb2.setId(from.getIndex2Id());
            to.setIndex2(tb2);
        }
    }
    setBigDecimal(to::setInitialVolume, from.getInitialVolume());
    setBigDecimal(to::setVolume, from.getVolume());
    to.setVolumeUnits(from.getVolumeUnits());
    setBigDecimal(to::setVolumeUsed, from.getVolumeUsed());
    setBigDecimal(to::setNgUsed, from.getNgUsed());
    to.setDnaSize(from.getDnaSize());
    if (from.getKitDescriptorId() != null) {
        KitDescriptor kitDescriptor = new KitDescriptor();
        kitDescriptor.setId(from.getKitDescriptorId());
        to.setKitDescriptor(kitDescriptor);
    }
    setString(to::setKitLot, from.getKitLot());
    to.setLocationBarcode(from.getLocationBarcode());
    to.setCreationDate(parseDate(from.getCreationDate()));
    to.setBoxPosition((LibraryBoxPosition) makeBoxablePosition(from, (LibraryImpl) to));
    to.setDiscarded(from.isDiscarded());
    setObject(to::setSpikeIn, LibrarySpikeIn::new, from.getSpikeInId());
    setBigDecimal(to::setSpikeInVolume, from.getSpikeInVolume());
    setObject(to::setSpikeInDilutionFactor, from.getSpikeInDilutionFactor(), DilutionFactor::get);
    setBoolean(to::setUmis, from.getUmis(), false);
    setObject(to::setWorkstation, Workstation::new, from.getWorkstationId());
    setObject(to::setThermalCycler, InstrumentImpl::new, from.getThermalCyclerId());
    setObject(to::setSop, Sop::new, from.getSopId());
    to.setCreationReceiptInfo(toReceiptTransfer(from, to));
    return to;
}
Also used : LibraryStrategyType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType) InstrumentImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl) LibrarySelectionType(uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType) LibraryType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType) DetailedQcStatusImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl) Index(uk.ac.bbsrc.tgac.miso.core.data.Index) Workstation(uk.ac.bbsrc.tgac.miso.core.data.Workstation) DilutionFactor(uk.ac.bbsrc.tgac.miso.core.data.type.DilutionFactor) KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) Sop(uk.ac.bbsrc.tgac.miso.core.data.impl.Sop) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) LibrarySpikeIn(uk.ac.bbsrc.tgac.miso.core.data.LibrarySpikeIn) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) ParentLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) WorksetLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibrary) Library(uk.ac.bbsrc.tgac.miso.core.data.Library) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) SampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)

Example 5 with Workstation

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

the class HibernateWorkstationDaoIT method testUpdate.

@Test
public void testUpdate() throws IOException {
    long id = 1L;
    String alias = "New Alias";
    Workstation workstation = (Workstation) getSessionFactory().getCurrentSession().get(Workstation.class, id);
    assertNotEquals(alias, workstation.getAlias());
    workstation.setAlias(alias);
    sut.update(workstation);
    clearSession();
    Workstation saved = (Workstation) getSessionFactory().getCurrentSession().get(Workstation.class, id);
    assertEquals(alias, saved.getAlias());
}
Also used : Workstation(uk.ac.bbsrc.tgac.miso.core.data.Workstation) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

Workstation (uk.ac.bbsrc.tgac.miso.core.data.Workstation)7 Test (org.junit.Test)4 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)4 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)3 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)3 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)3 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)3 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)3 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)3 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)3 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)3 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)3 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)3 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)3 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)3 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)3 InstrumentImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl)2 DetailedLibrary (uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary)1 Index (uk.ac.bbsrc.tgac.miso.core.data.Index)1 Instrument (uk.ac.bbsrc.tgac.miso.core.data.Instrument)1