}
public class PrintJobMapper implements RowMapper<PrintJob> {
public PrintJob mapRow(ResultSet rs, int rowNum) throws SQLException {
try {
MisoPrintJob printJob = new MisoPrintJob();
printJob.setJobId(rs.getLong("jobId"));
printJob.setPrintDate(rs.getDate("printDate"));
printJob.setPrintService(printManager.getPrintService(rs.getString("printServiceName")));
printJob.setPrintUser(securityManager.getUserById(rs.getLong("jobCreator_userId")));
Blob barcodeBlob = rs.getBlob("printedElements");
if (barcodeBlob != null) {
if (barcodeBlob.length() > 0) {
byte[] rbytes = barcodeBlob.getBytes(1, (int)barcodeBlob.length());
printJob.setQueuedElements((Queue<?>)LimsUtils.byteArrayToObject(rbytes));
}
}
printJob.setStatus(rs.getString("status"));
return printJob;
}
catch (IOException e) {
e.printStackTrace();
}