Search in sources :

Example 1 with PoreVersion

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

the class Dtos method to.

public static SequencerPartitionContainer to(@Nonnull ContainerDto from) {
    SequencerPartitionContainer to = null;
    if (from instanceof OxfordNanoporeContainerDto) {
        OxfordNanoporeContainerDto ontFrom = (OxfordNanoporeContainerDto) from;
        OxfordNanoporeContainer ontTo = new OxfordNanoporeContainer();
        setObject(ontTo::setPoreVersion, PoreVersion::new, ontFrom.getPoreVersionId());
        setDate(ontTo::setReceivedDate, ontFrom.getReceivedDate());
        setDate(ontTo::setReturnedDate, ontFrom.getReturnedDate());
        to = ontTo;
    } else {
        to = new SequencerPartitionContainerImpl();
    }
    setLong(to::setId, from.getId(), false);
    setString(to::setIdentificationBarcode, from.getIdentificationBarcode());
    setObject(to::setModel, SequencingContainerModel::new, maybeGetProperty(from.getModel(), SequencingContainerModelDto::getId));
    setString(to::setDescription, from.getDescription());
    setObject(to::setClusteringKit, KitDescriptor::new, from.getClusteringKitId());
    setString(to::setClusteringKitLot, from.getClusteringKitLot());
    setObject(to::setMultiplexingKit, KitDescriptor::new, from.getMultiplexingKitId());
    setString(to::setMultiplexingKitLot, from.getMultiplexingKitLot());
    return to;
}
Also used : SequencerPartitionContainer(uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) OxfordNanoporeContainer(uk.ac.bbsrc.tgac.miso.core.data.impl.OxfordNanoporeContainer) SequencerPartitionContainerImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl) PoreVersion(uk.ac.bbsrc.tgac.miso.core.data.impl.PoreVersion) 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 PoreVersion

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

the class EditSequencerPartitionContainerController method includeForeignKeys.

/**
 * Translates foreign keys to entity objects with only the ID set, to be used in service layer to reload persisted child objects
 *
 * @param binder
 */
@InitBinder
public void includeForeignKeys(WebDataBinder binder) {
    binder.registerCustomEditor(PoreVersion.class, new PropertyEditorSupport() {

        @Override
        public void setAsText(String text) {
            if (text.isEmpty()) {
                setValue(null);
            } else {
                PoreVersion v = new PoreVersion();
                v.setId(Long.valueOf(text));
                setValue(v);
            }
        }
    });
    binder.registerCustomEditor(Date.class, "receivedDate", new CustomDateEditor(LimsUtils.getDateFormat(), false));
    binder.registerCustomEditor(Date.class, "returnedDate", new CustomDateEditor(LimsUtils.getDateFormat(), true));
}
Also used : CustomDateEditor(org.springframework.beans.propertyeditors.CustomDateEditor) PoreVersion(uk.ac.bbsrc.tgac.miso.core.data.impl.PoreVersion) PropertyEditorSupport(java.beans.PropertyEditorSupport) InitBinder(org.springframework.web.bind.annotation.InitBinder)

Example 3 with PoreVersion

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

the class HibernateSequencerPartitionContainerDao method listPoreVersions.

@Override
public List<PoreVersion> listPoreVersions() {
    Criteria criteria = currentSession().createCriteria(PoreVersion.class);
    @SuppressWarnings("unchecked") List<PoreVersion> results = criteria.list();
    return results;
}
Also used : Criteria(org.hibernate.Criteria) PoreVersion(uk.ac.bbsrc.tgac.miso.core.data.impl.PoreVersion)

Aggregations

PoreVersion (uk.ac.bbsrc.tgac.miso.core.data.impl.PoreVersion)3 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)1 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)1 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)1 PropertyEditorSupport (java.beans.PropertyEditorSupport)1 Criteria (org.hibernate.Criteria)1 CustomDateEditor (org.springframework.beans.propertyeditors.CustomDateEditor)1 InitBinder (org.springframework.web.bind.annotation.InitBinder)1 SequencerPartitionContainer (uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer)1 OxfordNanoporeContainer (uk.ac.bbsrc.tgac.miso.core.data.impl.OxfordNanoporeContainer)1 SequencerPartitionContainerImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl)1 SequencingContainerModel (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel)1 KitDescriptor (uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor)1 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)1 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)1 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)1 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)1 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)1 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)1 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)1