|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
org.itracker.persistence.dao.BaseHibernateDAOImpl<Issue>
org.itracker.persistence.dao.IssueDAOImpl
public class IssueDAOImpl
Default implementation of IssueDAO using Hibernate.
| Field Summary |
|---|
| Fields inherited from class org.springframework.dao.support.DaoSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
IssueDAOImpl()
|
|
| Method Summary | |
|---|---|
Long |
countAllIssues()
Count all Issues in database |
Long |
countByComponent(Integer componentId)
Counts the number of issues attached to a component. |
Long |
countByProject(Integer projectId)
Counts the number of issues of the given project. |
Long |
countByProjectAndHigherStatus(Integer projectId,
int minStatus)
Counts the number of issues of the given project with a status higher than or equal to the given one. |
Long |
countByProjectAndLowerStatus(Integer projectId,
int maxExclusiveStatus)
Counts the number of issues of the given project with a status lower than the given one. |
Long |
countByVersion(Integer versionId)
Counts the number of issues attached to a version. |
List<Issue> |
findAll()
Finds all issues in all projects. |
List<Issue> |
findByComponent(Integer componentId)
Finds all issues of the component with the given ID. |
List<Issue> |
findByCreator(Integer creatorId,
int maxExclusiveStatus)
Finds all issues created by the given user in all projects and with a status less than the given one. |
List<Issue> |
findByCreatorInAvailableProjects(Integer creatorId,
int maxExclusiveStatus)
Finds all issues created by the given user in all active and viewable projects and with a status less than the given one. |
List<Issue> |
findByNotification(Integer userId,
int maxExclusiveStatus)
Finds all issues with notifications for the given user in all projects and with a status less than the given one. |
List<Issue> |
findByNotificationInAvailableProjects(Integer userId,
int maxExclusiveStatus)
Finds all issues with notifications for the given user in active and viewable projects. |
List<Issue> |
findByOwner(Integer ownerId,
int maxExclusiveStatus)
Finds all issues owned by the given user in all projects and with a status lower than the given one. |
List<Issue> |
findByOwnerInAvailableProjects(Integer ownerId,
int maxExclusiveStatus)
Finds all issues owned by the given user in all active and viewable projects and with a status less than the given one. |
Issue |
findByPrimaryKey(Integer issueId)
Finds the issue with the given ID. |
List<Issue> |
findByProject(Integer projectId)
Finds all issues of the given project. |
List<Issue> |
findByProjectAndHigherStatus(Integer projectId,
int status)
Finds all issues of the given project with a status higher than or equal to the given one. |
List<Issue> |
findByProjectAndLowerStatus(Integer projectId,
int maxExclusiveStatus)
Finds all issues of the given project with a status lower than the given one. |
List<Issue> |
findBySeverity(int severity)
Finds all issues with the given severity in all projects. |
List<Issue> |
findByStatus(int status)
Finds all issues in the given status in all projects. |
List<Issue> |
findByStatusLessThan(int maxExclusiveStatus)
Finds all issues with a status less than the given one in all projects. |
List<Issue> |
findByStatusLessThanEqualTo(int maxStatus)
Finds all issues with a status less than or equal to the given status in all projects. |
List<Issue> |
findByStatusLessThanEqualToInAvailableProjects(int maxStatus)
Finds all issues with a status less than or equal to the given status in active and viewable projects. |
List<Issue> |
findByTargetVersion(Integer versionId)
Delete all issues targeted for the specified version. |
List<Issue> |
findByVersion(Integer versionId)
Finds all issues of the version with the given ID. |
List<Issue> |
findUnassignedIssues(int maxStatus)
Finds all issues without owner with a status less than or equal to the given one in all projects. |
ProjectDAO |
getProjectDAO()
|
Date |
latestModificationDate(Integer projectId)
Returns the modification date of the latest modified issue in the project with the given id. |
List<Issue> |
query(IssueSearchQuery searchQuery,
User user,
Map<Integer,Set<PermissionType>> userPermissions)
It doens't really make sense for this method to receive projectDAO, it's just a quick fix for the fact that IssueSearchQuery handles ids and not objects |
void |
setProjectDAO(ProjectDAO projectDAO)
|
| Methods inherited from class org.itracker.persistence.dao.BaseHibernateDAOImpl |
|---|
delete, detach, merge, refresh, save, saveOrUpdate |
| Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
|---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
| Methods inherited from class org.springframework.dao.support.DaoSupport |
|---|
afterPropertiesSet, initDao |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.itracker.persistence.dao.BaseDAO |
|---|
delete, detach, merge, refresh, save, saveOrUpdate |
| Constructor Detail |
|---|
public IssueDAOImpl()
| Method Detail |
|---|
public Issue findByPrimaryKey(Integer issueId)
IssueDAOPENDING: should this method throw a NoSuchEntityException instead of returning null if the issue doesn't exist ?
findByPrimaryKey in interface IssueDAOissueId - ID of the issue to retrieve
public Long countAllIssues()
IssueDAO
countAllIssues in interface IssueDAOpublic List<Issue> findAll()
IssueDAOPENDING: do we really need to retrieve all issues at once ? It can cause OutOfMemoryError depending on the DB size! Consider scrolling through an issues result set in case we really do.
findAll in interface IssueDAOpublic List<Issue> findByStatus(int status)
IssueDAO
findByStatus in interface IssueDAOstatus - status of the issues to return
public List<Issue> findByStatusLessThan(int maxExclusiveStatus)
IssueDAO
findByStatusLessThan in interface IssueDAOmaxExclusiveStatus - all issues under this status will be returned
public List<Issue> findByStatusLessThanEqualTo(int maxStatus)
IssueDAO
findByStatusLessThanEqualTo in interface IssueDAOmaxStatus - all issues less that or equal to this status will be returned
public List<Issue> findByStatusLessThanEqualToInAvailableProjects(int maxStatus)
IssueDAO
findByStatusLessThanEqualToInAvailableProjects in interface IssueDAOmaxStatus - all issues less that or equal to this status will be returned
public List<Issue> findBySeverity(int severity)
IssueDAO
findBySeverity in interface IssueDAOseverity - severity of the issues to return
public List<Issue> findByProject(Integer projectId)
IssueDAO
findByProject in interface IssueDAOprojectId - ID of the project of which to retrieve all issues
public Long countByProject(Integer projectId)
IssueDAO
countByProject in interface IssueDAOprojectId - ID of the project of which to count issues
public List<Issue> findByProjectAndLowerStatus(Integer projectId,
int maxExclusiveStatus)
IssueDAO
findByProjectAndLowerStatus in interface IssueDAOprojectId - ID of the project of which to retrieve the issuesmaxExclusiveStatus - all issues under this status will be returned
public Long countByProjectAndLowerStatus(Integer projectId,
int maxExclusiveStatus)
IssueDAO
countByProjectAndLowerStatus in interface IssueDAOprojectId - ID of the project of which to count issuesmaxExclusiveStatus - all issues under this status will be counted
public List<Issue> findByProjectAndHigherStatus(Integer projectId,
int status)
IssueDAO
findByProjectAndHigherStatus in interface IssueDAOprojectId - ID of the project of which to retrieve the issuesstatus - all issues with this status or above will be returned
public Long countByProjectAndHigherStatus(Integer projectId,
int minStatus)
IssueDAO
countByProjectAndHigherStatus in interface IssueDAOprojectId - ID of the project of which to count issuesminStatus - all issues with this status or above will be counted
public List<Issue> findByOwner(Integer ownerId,
int maxExclusiveStatus)
IssueDAO
findByOwner in interface IssueDAOownerId - ID of the user who owns the issues to returnmaxExclusiveStatus - status under which to return issues
public List<Issue> findByOwnerInAvailableProjects(Integer ownerId,
int maxExclusiveStatus)
IssueDAO
findByOwnerInAvailableProjects in interface IssueDAOownerId - ID of the user who owns the issues to returnmaxExclusiveStatus - status under which to return issues
public List<Issue> findUnassignedIssues(int maxStatus)
IssueDAO
findUnassignedIssues in interface IssueDAOmaxStatus - maximum status allowed for the issues to return
public List<Issue> findByCreator(Integer creatorId,
int maxExclusiveStatus)
IssueDAO
findByCreator in interface IssueDAOmaxExclusiveStatus - all issues under this status will be returned
public List<Issue> findByCreatorInAvailableProjects(Integer creatorId,
int maxExclusiveStatus)
IssueDAO
findByCreatorInAvailableProjects in interface IssueDAOmaxExclusiveStatus - all issues under this status will be returned
public List<Issue> findByNotification(Integer userId,
int maxExclusiveStatus)
IssueDAOOnly 1 instance of every issue is returned, even if multiple notifications exist for an issue.
findByNotification in interface IssueDAOuserId - ID of the user with notifications for the issues to returnmaxExclusiveStatus - all issues under this status will be returned
public List<Issue> findByNotificationInAvailableProjects(Integer userId,
int maxExclusiveStatus)
IssueDAOOnly 1 instance of every issue is returned, even if multiple notifications exist for an issue.
findByNotificationInAvailableProjects in interface IssueDAOuserId - ID of the user with notifications for the issues to returnmaxExclusiveStatus - all issues under this status will be returned
public List<Issue> findByComponent(Integer componentId)
IssueDAO
findByComponent in interface IssueDAOcomponentId - ID of the component of which to retrieve all issues
public Long countByComponent(Integer componentId)
IssueDAO
countByComponent in interface IssueDAOcomponentId - ID of the component
public List<Issue> findByVersion(Integer versionId)
IssueDAO
findByVersion in interface IssueDAOversionId - ID of the version of which to retrieve all issues
public Long countByVersion(Integer versionId)
IssueDAO
countByVersion in interface IssueDAOversionId - ID of the version
public Date latestModificationDate(Integer projectId)
IssueDAO
latestModificationDate in interface IssueDAOprojectId - ID of the project of which to retrieve the issues
public List<Issue> query(IssueSearchQuery searchQuery,
User user,
Map<Integer,Set<PermissionType>> userPermissions)
query in interface IssueDAOsearchQuery - The search criteria.user - The currently logged-in user.userPermissions - Permissions currently inforced. TODO: We could look this up instead of passing this as parameter.
public ProjectDAO getProjectDAO()
public void setProjectDAO(ProjectDAO projectDAO)
public List<Issue> findByTargetVersion(Integer versionId)
findByTargetVersion in interface IssueDAOversionId - the version ID.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||