package org.appfuse.persistence;

import java.util.List;

import org.appfuse.model.Education;
import org.appfuse.model.Experience;
import org.appfuse.model.Membership;
import org.appfuse.model.Reference;
import org.appfuse.model.Resume;

/**
 * User Data Access Object (DAO) interface.
 */
public interface ResumeDAO extends DAO {
    //~ Methods ================================================================

    /**
     * Gets resume by name, create new resume if necessary.
     * 
     * @param userId the user's id
     * @throws DAOException
     */
    public List getResumesByUserId(Long userId) throws DAOException;

    /**
     * Gets a resume based on a resume's id
     *
     * @param resumeId
     * @return Resume
     * @throws DAOException
     */
    public Resume getResume(Long resumeId) throws DAOException;

    /**
     * Deletes a resume.
     *
     * @param o the object to remove
     * @throws DAOException
     */
    public void removeResume(Object o) throws DAOException;

    /**
     * Generic method to save an object - handles both update and insert.
     * @param o the object to save
     * @throws DAOException
     */
    public Object saveObject(Object o) throws DAOException;

    /**
     * Generic method to delete an object
     * @param o the object to delete
     * @throws DAOException
     */
    public void removeObject(Object o) throws Exception;

    /**
     * Gets a list of education experiences based on the passed in resumeId.
     * @param resumeId
     * @return
     * @throws DAOException
     */
    public List getSchools(Long resumeId) throws DAOException;
    
    /**
     * Gets a specific education experience based on its id.
     * @param id
     * @return
     * @throws DAOException
     */
    public Education getEducation(Long id) throws DAOException;

    /**
     * Gets a list of work experiences based on the passed in resumeId.
     * @param resumeId
     * @return
     * @throws DAOException
     */
    public List getWorkHistory(Long resumeId) throws DAOException;
    
    /**
     * Gets a specific work experience based on its id.
     * @param id
     * @return
     * @throws DAOException
     */
    public Experience getExperience(Long id) throws DAOException;

    /**
     * Gets a list of references based on the passed in resumeId.
     * @param resumeId
     * @return
     * @throws DAOException
     */
    public List getReferences(Long resumeId) throws DAOException;

    /**
     * Gets a specific reference based on its id.
     * @param id
     * @return
     * @throws DAOException
     */
    public Reference getReference(Long id) throws DAOException;

        /**
     * Gets a list of memberships based on the passed in resumeId.
     * @param resumeId
     * @return
     * @throws DAOException
     */
    public List getMemberships(Long resumeId) throws DAOException;

    /**
     * Gets a specific membership based on its id.
     * @param id
     * @return
     * @throws DAOException
     */
    public Membership getMembership(Long id) throws DAOException;
}