public void changeStudent() { try { pmap.clear(); sessions.clear(); day = null; hour = null; if (command == 0) { childList.clear(); selectedChild = -1; cdetail = null; searched = false; } sdetail = studentdao.findByID(selectedStudent); smap = savaildao.findByID(selectedStudent); skeys.clear(); for (Map.Entry<String, List<String>> entry : smap.entrySet()) { skeys.add(entry.getKey()); } // get the number of pairs for this student pairsCount = getPairsCount(selectedStudent); if (pairsCount > 0) { Student student = new Student(); student.setStudentID(selectedStudent); for (Session pairing : padao.findByStudent(student)) sessions.add(pairing); for (Session pending : pedao.findByStudent(student)) sessions.add(pending); } // now populate days and hours in common if child is also selected if (selectedChild != -1) this.findDaysAndHours(); } catch (SQLException ex) { Logger.getLogger(AdminPairing.class.getName()).log(Level.SEVERE, null, ex); } }