Skip to content

Commit

Permalink
API Changes code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kalai-tw committed Feb 13, 2024
1 parent c16474d commit abf592a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import org.springframework.stereotype.Repository;

import org.hibernate.query.Query;

import java.util.ArrayList;
import java.util.List;

@Repository
Expand Down Expand Up @@ -47,9 +49,9 @@ public List<AdmittedPatient> getAdmittedPatients(Location location) {
return query.getResultList();
}
catch (Exception ex){
System.out.println("Exception trace " + ex.getStackTrace());
log.error("Exception at WardDAO getAdmittedPatients ",ex.getStackTrace());
}
return null;
return new ArrayList<>();
}

@Override
Expand All @@ -66,9 +68,9 @@ public WardPatientsSummary getWardPatientSummary(Location location) {
query.setParameter("location", location);
return (WardPatientsSummary) query.getSingleResult();
} catch (Exception e) {
System.out.println("Exception getPatientStats "+ e.getStackTrace()); // Handle any exception that occurs during query execution
log.error("Exception at WardDAO getAdmittedPatients ",e.getStackTrace());
}
return null;
return new WardPatientsSummary();
}

}

0 comments on commit abf592a

Please sign in to comment.