1 package org.itracker.persistence.dao;
2
3 import org.itracker.model.Project;
4
5 import java.util.Date;
6 import java.util.List;
7
8 /**
9 *
10 */
11 public interface ProjectDAO extends BaseDAO<Project> {
12
13 /**
14 * Finds a project by ID.
15 *
16 * @param projectId sytem ID
17 * @return project instance or <tt>null</tt>
18 */
19 Project findByPrimaryKey(Integer projectId);
20
21 /**
22 * Finds all projects.
23 *
24 * @return list of all existing projects, in unspecified order
25 */
26 List<Project> findAll();
27
28 /**
29 * Finds all projects with a given status.
30 *
31 * @param status project status
32 * @return list of projects in unspecified order
33 */
34 List<Project> findByStatus(int status);
35
36 /**
37 * Finds all projects that are active or viewable.
38 *
39 * @return list of projects in unspecified order
40 */
41 List<Project> findAllAvailable();
42
43 /**
44 * Returns the projects with id projectId latest modified issues modification date
45 */
46 public Date getLastIssueUpdateDate(Integer projectId);
47
48 /**
49 * Finds a project by name.
50 *
51 * @param name project
52 * @return the project by name or null if it does not exist in database.
53 */
54 Project findByName(String name);
55 }