test_class.declarator: patientDao
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private PatientDao patientDao;
test_class.type: PatientDao
test_class.var_name: patientDao
test_class.file: pipeline/src/test/java/uk/ac/kcl/iop/brc/core/pipeline/dncpipeline/data/PatientDaoTest.java
test_class.identifier: PatientDaoTest
test_class.superclass: extends IntegrationTest
test_case.body: @Test
      @Ignore
      public void shouldFetchPatientFasterAfterCachingPatient() {
          patientDao.executeSQLQueryForSource("insert into tblPatient values(1, '123123', '')");
          patientDao.executeSQLQueryForSource("insert into tblPatientNames values('michael', 'gregorski', 1)");
          patientDao.executeSQLQueryForSource("insert into tblPatientNames values('micha', 'gregor', 1)");
          patientDao.executeSQLQueryForSource("insert into tblPatientAddresses values('address1','cb4 2za', 1)");
          patientDao.executeSQLQueryForSource("insert into tblPatientAddresses values('address2','cb4 2za', 1)");
          patientDao.executeSQLQueryForSource("insert into tblPatientPhoneNumbers values('213123', 1)");
          patientDao.executeSQLQueryForSource("insert into tblPatientPhoneNumbers values('0778', 1)");
  
          long start1 = System.nanoTime();
          Patient patient = patientDao.getPatient(1L);
          long end1 = System.nanoTime();
          long diff1 = end1-start1;
          long start2 = System.nanoTime();
          patient = patientDao.getPatient(1L);
          long end2 = System.nanoTime();
          long diff2 = end2-start2;
  
          assertTrue(diff2 <= diff1);
      }
test_case.class_method_signature: PatientDaoTest.shouldFetchPatientFasterAfterCachingPatient()
test_case.full_signature: @Test @Ignore public void shouldFetchPatientFasterAfterCachingPatient()
test_case.identifier: shouldFetchPatientFasterAfterCachingPatient
test_case.invocations: executeSQLQueryForSource executeSQLQueryForSource executeSQLQueryForSource executeSQLQueryForSource executeSQLQueryForSource executeSQLQueryForSource executeSQLQueryForSource nanoTime getPatient nanoTime nanoTime getPatient nanoTime assertTrue
test_case.modifiers: @Test @Ignore public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldFetchPatientFasterAfterCachingPatient()
focal_class.declarator: clobHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ClobHelper clobHelper;
focal_class.type: ClobHelper
focal_class.var_name: clobHelper
focal_class.declarator: logger = Logger.getLogger(PatientDao.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = Logger.getLogger(PatientDao.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: pipeline/src/main/java/uk/ac/kcl/iop/brc/core/pipeline/dncpipeline/data/PatientDao.java
focal_class.identifier: PatientDao
focal_class.class_method_signature: PatientDao.getPatient(Long id)
focal_class.full_signature: @Cacheable(value = "patients", key = "#id") public Patient getPatient(Long id)
focal_class.identifier: getPatient
focal_class.modifiers: @Cacheable(value = "patients", key = "#id") public
focal_class.parameters: (Long id)
focal_class.return: Patient
focal_class.signature: Patient getPatient(Long id)
focal_class.class_method_signature: PatientDao.setNhsNumbers(Patient patient)
focal_class.full_signature: private void setNhsNumbers(Patient patient)
focal_class.identifier: setNhsNumbers
focal_class.modifiers: private
focal_class.parameters: (Patient patient)
focal_class.return: void
focal_class.signature: void setNhsNumbers(Patient patient)
focal_class.class_method_signature: PatientDao.setDateOfBirths(Patient patient)
focal_class.full_signature: private void setDateOfBirths(Patient patient)
focal_class.identifier: setDateOfBirths
focal_class.modifiers: private
focal_class.parameters: (Patient patient)
focal_class.return: void
focal_class.signature: void setDateOfBirths(Patient patient)
focal_class.class_method_signature: PatientDao.setCarers(Patient patient)
focal_class.full_signature: private void setCarers(Patient patient)
focal_class.identifier: setCarers
focal_class.modifiers: private
focal_class.parameters: (Patient patient)
focal_class.return: void
focal_class.signature: void setCarers(Patient patient)
focal_class.class_method_signature: PatientDao.setPhoneNumbers(Patient patient)
focal_class.full_signature: private void setPhoneNumbers(Patient patient)
focal_class.identifier: setPhoneNumbers
focal_class.modifiers: private
focal_class.parameters: (Patient patient)
focal_class.return: void
focal_class.signature: void setPhoneNumbers(Patient patient)
focal_class.class_method_signature: PatientDao.setAddresses(Patient patient)
focal_class.full_signature: private void setAddresses(Patient patient)
focal_class.identifier: setAddresses
focal_class.modifiers: private
focal_class.parameters: (Patient patient)
focal_class.return: void
focal_class.signature: void setAddresses(Patient patient)
focal_class.class_method_signature: PatientDao.setNames(Patient patient)
focal_class.full_signature: private void setNames(Patient patient)
focal_class.identifier: setNames
focal_class.modifiers: private
focal_class.parameters: (Patient patient)
focal_class.return: void
focal_class.signature: void setNames(Patient patient)
focal_class.superclass: extends BaseDao
focal_method.body: @Cacheable(value = "patients", key = "#id")
      public Patient getPatient(Long id) {
          SessionWrapper sessionWrapper = getCurrentSourceSession();
          try {
              Query getPatient = sessionWrapper.getNamedQuery("getPatient");
              getPatient.setParameter("patientId", id);
              logger.info("Loading patient " + id);
              Patient patient = (Patient) getPatient.
                      setFirstResult(0).setMaxResults(1).
                      setResultTransformer(Transformers.aliasToBean(Patient.class)).uniqueResult();
  
              setNames(patient);
              setPhoneNumbers(patient);
              setAddresses(patient);
              setCarers(patient);
              setNhsNumbers(patient);
              setDateOfBirths(patient);
  
              return patient;
          } finally {
              sessionWrapper.closeSession();
          }
      }
focal_method.class_method_signature: PatientDao.getPatient(Long id)
focal_method.full_signature: @Cacheable(value = "patients", key = "#id") public Patient getPatient(Long id)
focal_method.identifier: getPatient
focal_method.invocations: getCurrentSourceSession getNamedQuery setParameter info uniqueResult setResultTransformer setMaxResults setFirstResult aliasToBean setNames setPhoneNumbers setAddresses setCarers setNhsNumbers setDateOfBirths closeSession
focal_method.modifiers: @Cacheable(value = "patients", key = "#id") public
focal_method.parameters: (Long id)
focal_method.return: Patient
focal_method.signature: Patient getPatient(Long id)