@Override public void update(Student obj) { Student st = this.getByID(obj.getID()); st.setDb(null); try { st.setName(obj.getName()); } catch (RepositoryException e) { // TODO Auto-generated catch block e.printStackTrace(); } st.setDb(this.db); }
@Override public void updateStudent(Student student, String new_name, String new_surname) throws RepositoryException { Student st = this.getByID(student.getID()); st.setDb(null); try { st.setName(new_name); st.setSurname(new_surname); } catch (RepositoryException e) { // TODO Auto-generated catch block e.printStackTrace(); } st.setDb(this.db); }
@Override public void insert(Student obj) { obj.setID(MaxStudentID() + 1); obj.setDb(db); students.add(obj); }