AuditRepositoryDAO { public Blob queryByAuditId(final long auditId) { Session session = null; Blob message = null; try { session = getSession(); LOG.info("Getting Record for Audit Viewer using auditId"); if (session != null) { final Criteria queryCriteria = session.createCriteria(AuditRepositoryRecord.class); queryCriteria.add(Restrictions.eq("id", auditId)); queryCriteria.setProjection(Projections.property("message")); message = (Blob) queryCriteria.uniqueResult(); } } catch (final HibernateException e) { LOG.error("Exception in AuditLog.get() occurred due to : {}", e.getLocalizedMessage(), e); } finally { closeSession(session); } return message; } AuditRepositoryDAO(); boolean insertAuditRepository(final List<AuditRepositoryRecord> auditList); List queryAuditRepositoryOnCriteria(final String eUserId, final String ePatientId, final Date startDate,
            final Date endDate); List<AuditRepositoryRecord> queryAuditRecords(final String messageId, final String relatesTo); List<AuditRepositoryRecord> queryByAuditOptions(final List<String> eventTypeList, final String userId,
            final List<String> remoteHcidList, final Date startDate, final Date endDate); Blob queryByAuditId(final long auditId);  }
@Test public void testQueryByAuditId() { int auditId = 15; Blob message = auditLogDao.queryByAuditId(auditId); assertNotNull(message); }