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;
}
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));
}
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;
}
Aggregations