OwnerDao.java 1.51 KB
Newer Older
1 2 3 4 5 6
package at.ac.tuwien.sepm.assignment.individual.persistence;

import at.ac.tuwien.sepm.assignment.individual.entity.Owner;
import at.ac.tuwien.sepm.assignment.individual.exception.NotFoundException;
import org.springframework.dao.DataAccessException;

7 8
import java.io.IOException;

9 10 11 12 13 14 15 16 17 18
public interface OwnerDao {

    /**
     * @param id of the owner to find.
     * @return the owner with the specified id.
     * @throws DataAccessException will be thrown if something goes wrong during the database access.
     * @throws NotFoundException   will be thrown if the owner could not be found in the database.
     */
    Owner findOneById(Long id);

19 20
    /**
     * @param owner that specifies the owner to add
21
     * @return the newly created owner
22 23 24 25
     * @throws DataAccessException will be thrown if something goes wrong during the database access.
     */
    Owner addOwner(Owner owner);

26 27 28 29 30 31
    /**
     * @param owner that specifies the new owner values alongside with the id of the owner to update
     * @return the updated owner
     * @throws DataAccessException will be thrown if something goes wrong during the database access.
     */
    Owner updateOwner(Owner owner) throws DataAccessException;
32 33 34 35 36 37 38

    /**
     * @param id of the owner to delete
     * @throws DataAccessException will be thrown if something goes wrong during the database access.
     * @throws NotFoundException   will be thrown if the owner could not be found in the database.
     */
    void deleteOwner(Long id) throws DataAccessException, NotFoundException;
39
}