aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/dao/EmployeeDAO.java
blob: 675e951a3be84e2db0a72bc6c12d6ca6b1b5f645 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package at.ac.tuwien.sepm.assignment.groupphase.missioncontrol.dao;

import at.ac.tuwien.sepm.assignment.groupphase.exception.ElementNotFoundException;
import at.ac.tuwien.sepm.assignment.groupphase.exception.PersistenceException;
import at.ac.tuwien.sepm.assignment.groupphase.missioncontrol.dto.Employee;
import java.util.Set;

public interface EmployeeDAO {

    /**
     * Persist the given employee.
     *
     * @param employee that should be stored
     * @return the id that was assigned
     * @throws PersistenceException if the employee could not be persisted
     */
    long add(Employee employee) throws PersistenceException;

    /**
     * Update the given employee.
     *
     * @param employee that should be updated
     * @throws ElementNotFoundException if no employee with the given id exists
     * @throws PersistenceException if the employee could not be updated
     */
    void update(Employee employee) throws ElementNotFoundException, PersistenceException;

    /**
     * Get all stored employees.
     *
     * @return list containing all stored employees
     * @throws PersistenceException if loading the stored employees failed
     */
    Set<Employee> list() throws PersistenceException;

    /**
     * Remove employee with the given id from the store.
     *
     * @param id of the employee that should be removed
     * @throws ElementNotFoundException if no employee with the given id exists
     * @throws PersistenceException if the employee could not be removed
     */
    void remove(long id) throws ElementNotFoundException, PersistenceException;
}