Package be.gaudry.dao.edu
Interface IPersonDao
- All Known Implementing Classes:
DerbyPerson
public interface IPersonDao
- Since:
- 1.0 Oct 13, 2008
- Author:
- Steph GAUDRY
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(int personId)Removes a person from the database.\n Do not use this method to delete a student or a teacher...voiddeleteStudent(int studentId)Removes a person from the database.getPicture(int personId)voidloadAsyncPersonsLos(AbstractBrolWorker worker)voidloadAsyncStudentsLos(AbstractBrolWorker<Integer> worker)Loads in a separated process the list of students.voidloadAsyncTeachersLos(AbstractBrolWorker<Integer> worker)loadPerson(int id)loadPerson(String firstName, String lastName)loadStudent(int id)loadStudents(List<Integer> studentsIds)Loads a list of students.
Be careful: for each student, the school will contains only school's id.loadStudentsForSchool(int schoolId)Loads a list of students.loadTeacher(int id)intsaveOrUpdate(Student student)intsaveOrUpdate(Teacher teacher)intsaveOrUpdate(Person person)voidsavePicture(int personId, File pictureFile)
-
Method Details
-
loadAsyncPersonsLos
- Parameters:
worker- to allow loading the list asynchronous and sending each result in an Object[]
-
loadPerson
- Parameters:
id-- Returns:
-
loadPerson
-
saveOrUpdate
- 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
- Parameters:
worker- to allow loading the list asynchronous and sending each result in an Object[]
-
loadTeacher
- Parameters:
id-- Returns:
-
saveOrUpdate
- Parameters:
teacher-
-
loadAsyncStudentsLos
Loads in a separated process the list of students. OnlyLightObjects(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 theloadStudent(int)method- Parameters:
worker- to allow loading the list asynchronous and sending each result in an Object[]
-
loadStudent
- Parameters:
id-- Returns:
-
loadStudents
Loads a list of students.
Be careful: for each student, the school will contains only school's id.- Parameters:
studentsIds-- Returns:
-
loadStudentsForSchool
Loads a list of students. If schoolId > -1, loads only students for this school- Parameters:
schoolId-- Returns:
-
saveOrUpdate
- Parameters:
student- Student to be saved or modified
-
getPicture
- Parameters:
personId-- Returns:
- Picture of the person, or null if nothing found
-
savePicture
-