@Test public void getPatientData() { persistMultipleTestEntities(PATIENT_DATA_COUNT); PatientData refData = TestPLCEntityFactory.createPatientData(); Filter filter = new Filter(); List<FileInfo> results = getTestDao().getPatientData(filter); assertTrue(results.isEmpty()); Set<String> tags = new HashSet<String>(); tags.add("Experimental"); filter.setTags(tags); results = getTestDao().getPatientData(filter); assertEquals(PATIENT_DATA_COUNT, results.size()); for (FileInfo info: results) { assertTrue(StringUtils.isNotEmpty(info.getFileName())); assertTrue(ArrayUtils.isNotEmpty(info.getFileData())); assertTrue(Arrays.equals(refData.getFileData(), info.getFileData())); } }
@SuppressWarnings("unchecked") @Override public List<FileInfo> getPatientData(Filter filter) { List<FileInfo> fileInfo = new ArrayList<FileInfo>(); if (!filter.valuesProvided()) { return fileInfo; } StringBuilder builder = generateQuery(filter, false, true); Query query = getEntityManager().createQuery(builder.toString()); populateQueryParams(filter, query); fileInfo.addAll(query.getResultList()); return fileInfo; }
PatientDataJPADao extends AbstractPLCEntityDao<PatientData> implements PatientDataDao { @SuppressWarnings("unchecked") @Override public List<FileInfo> getPatientData(Filter filter) { List<FileInfo> fileInfo = new ArrayList<FileInfo>(); if (!filter.valuesProvided()) { return fileInfo; } StringBuilder builder = generateQuery(filter, false, true); Query query = getEntityManager().createQuery(builder.toString()); populateQueryParams(filter, query); fileInfo.addAll(query.getResultList()); return fileInfo; } }
PatientDataJPADao extends AbstractPLCEntityDao<PatientData> implements PatientDataDao { @SuppressWarnings("unchecked") @Override public List<FileInfo> getPatientData(Filter filter) { List<FileInfo> fileInfo = new ArrayList<FileInfo>(); if (!filter.valuesProvided()) { return fileInfo; } StringBuilder builder = generateQuery(filter, false, true); Query query = getEntityManager().createQuery(builder.toString()); populateQueryParams(filter, query); fileInfo.addAll(query.getResultList()); return fileInfo; } @Inject  PatientDataJPADao(EntityManager em); }
PatientDataJPADao extends AbstractPLCEntityDao<PatientData> implements PatientDataDao { @SuppressWarnings("unchecked") @Override public List<FileInfo> getPatientData(Filter filter) { List<FileInfo> fileInfo = new ArrayList<FileInfo>(); if (!filter.valuesProvided()) { return fileInfo; } StringBuilder builder = generateQuery(filter, false, true); Query query = getEntityManager().createQuery(builder.toString()); populateQueryParams(filter, query); fileInfo.addAll(query.getResultList()); return fileInfo; } @Inject  PatientDataJPADao(EntityManager em); @SuppressWarnings("unchecked") @Transactional List<PatientData> getByAccountId(Long id); @Transactional @Override Summary getPatientDataSummary(Filter filter); @SuppressWarnings("unchecked") @Override List<FileInfo> getPatientData(Filter filter); @Override long normalizeFileSize(long size); }
PatientDataJPADao extends AbstractPLCEntityDao<PatientData> implements PatientDataDao { @SuppressWarnings("unchecked") @Override public List<FileInfo> getPatientData(Filter filter) { List<FileInfo> fileInfo = new ArrayList<FileInfo>(); if (!filter.valuesProvided()) { return fileInfo; } StringBuilder builder = generateQuery(filter, false, true); Query query = getEntityManager().createQuery(builder.toString()); populateQueryParams(filter, query); fileInfo.addAll(query.getResultList()); return fileInfo; } @Inject  PatientDataJPADao(EntityManager em); @SuppressWarnings("unchecked") @Transactional List<PatientData> getByAccountId(Long id); @Transactional @Override Summary getPatientDataSummary(Filter filter); @SuppressWarnings("unchecked") @Override List<FileInfo> getPatientData(Filter filter); @Override long normalizeFileSize(long size);  }