use of org.jbei.ice.lib.dto.ShotgunSequenceDTO in project ice by JBEI.
the class PartResource method getShotgunSequences.
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{id}/shotgunsequences")
public ArrayList<ShotgunSequenceDTO> getShotgunSequences(@Context final UriInfo info, @PathParam("id") final long partId, @DefaultValue("100") @QueryParam("limit") int limit, @DefaultValue("0") @QueryParam("start") int start) {
getUserId();
ShotgunSequenceDAO dao = DAOFactory.getShotgunSequenceDAO();
final EntryDAO entryDAO = DAOFactory.getEntryDAO();
final Entry entry = entryDAO.get(partId);
if (entry == null) {
return null;
}
ArrayList<ShotgunSequenceDTO> returns = new ArrayList<>();
List<ShotgunSequence> results = dao.getByEntry(entry);
for (ShotgunSequence ret : results) {
returns.add(new ShotgunSequenceDTO(ret));
}
Logger.info("Shotgun Sequences requested for entry " + partId);
return returns;
}
use of org.jbei.ice.lib.dto.ShotgunSequenceDTO in project ice by JBEI.
the class ShotgunSequence method toDataTransferObject.
// @Override
// public ShotgunSequenceDTO toDataTransferObject() {
// return null;
// }
@Override
public ShotgunSequenceDTO toDataTransferObject() {
ShotgunSequence info = new ShotgunSequence();
info.setId(this.getId());
info.setCreationTime(this.getCreationTime());
info.setFilename(this.getFilename());
info.setFileId(this.getFileId());
ShotgunSequenceDTO newShotgunDTO = new ShotgunSequenceDTO(info);
return newShotgunDTO;
}
Aggregations