Interface IPersonDao

All Known Implementing Classes:
DerbyPerson

public interface IPersonDao
Defines the general contract of Person management (including subclasses like Teacher or Student).
Since:
1.0 Oct 13, 2008
Author:
Steph GAUDRY
  • Method Details

    • loadAsyncPersonsLos

      void loadAsyncPersonsLos(AbstractBrolWorker worker)
      Parameters:
      worker - to allow loading the list asynchronous and sending each result in an Object[]
    • loadPerson

      Person loadPerson(int id)
      Parameters:
      id -
      Returns:
    • loadPerson

      Person loadPerson(String firstName, String lastName)
    • saveOrUpdate

      int saveOrUpdate(Person person)
      Parameters:
      person -
    • delete

      void delete(int personId)
      Removes a person from the database.\n Do not use this method to delete a student or a teacher...
      Parameters:
      personId - ID of the person to be deleted
      See Also:
      deleteStudent(int)
    • deleteStudent

      void deleteStudent(int studentId)
      Removes a person from the database. If this person is a teacher or a student, deletes also in corresponding table.
      Parameters:
      studentId - student id Not same as the person id
    • loadAsyncTeachersLos

      void loadAsyncTeachersLos(AbstractBrolWorker<Integer> worker)
      Parameters:
      worker - to allow loading the list asynchronous and sending each result in an Object[]
    • loadTeacher

      Teacher loadTeacher(int id)
      Parameters:
      id -
      Returns:
    • saveOrUpdate

      int saveOrUpdate(Teacher teacher)
      Parameters:
      teacher -
    • loadAsyncStudentsLos

      void loadAsyncStudentsLos(AbstractBrolWorker<Integer> worker)
      Loads in a separated process the list of students. Only LightObjects (an id and a display) are given to the view.
      The ids are Student's ids and not person's ids, because the id is needed by the loadStudent(int) method
      Parameters:
      worker - to allow loading the list asynchronous and sending each result in an Object[]
    • loadStudent

      Student loadStudent(int id)
      Parameters:
      id -
      Returns:
    • loadStudents

      List<Student> loadStudents(List<Integer> studentsIds)
      Loads a list of students.
      Be careful: for each student, the school will contains only school's id.
      Parameters:
      studentsIds -
      Returns:
    • loadStudentsForSchool

      List<Student> loadStudentsForSchool(int schoolId)
      Loads a list of students. If schoolId > -1, loads only students for this school
      Parameters:
      schoolId -
      Returns:
    • saveOrUpdate

      int saveOrUpdate(Student student)
      Parameters:
      student - Student to be saved or modified
    • getPicture

      Image getPicture(int personId)
      Parameters:
      personId -
      Returns:
      Picture of the person, or null if nothing found
    • savePicture

      void savePicture(int personId, File pictureFile)