org.itracker.persistence.dao
Interface IssueDAO

All Superinterfaces:
BaseDAO<Issue>
All Known Implementing Classes:
IssueDAOImpl

public interface IssueDAO
extends BaseDAO<Issue>

Issue Data Access Object interface.


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()
          Deprecated. don't use due to expensive memory use.
 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 minStatus)
          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.
 Date latestModificationDate(Integer projectId)
          Returns the modification date of the latest modified issue in the project with the given id.
 List<Issue> query(IssueSearchQuery queryModel, User user, Map<Integer,Set<PermissionType>> userPermissions)
          Query the list of issues that satisfies the search criteria specified in queryModel.
 
Methods inherited from interface org.itracker.persistence.dao.BaseDAO
delete, detach, merge, refresh, save, saveOrUpdate
 

Method Detail

findByPrimaryKey

Issue findByPrimaryKey(Integer issueId)
Finds the issue with the given ID.

PENDING: should this method throw a NoSuchEntityException instead of returning null if the issue doesn't exist ?

Parameters:
issueId - ID of the issue to retrieve
Returns:
issue with the given ID or null if none exits

findAll

List<Issue> findAll()
Deprecated. don't use due to expensive memory use.

Finds all issues in all projects.

PENDING: 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.

Returns:
list of exiting issues, in an unspecified order

findByStatus

List<Issue> findByStatus(int status)
Finds all issues in the given status in all projects.

Parameters:
status - status of the issues to return
Returns:
list of issues matching the above filter, in an unspecified order

findByStatusLessThan

List<Issue> findByStatusLessThan(int maxExclusiveStatus)
Finds all issues with a status less than the given one in all projects.

Parameters:
maxExclusiveStatus - all issues under this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

findByStatusLessThanEqualTo

List<Issue> findByStatusLessThanEqualTo(int maxStatus)
Finds all issues with a status less than or equal to the given status in all projects.

Parameters:
maxStatus - all issues less that or equal to this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

findByStatusLessThanEqualToInAvailableProjects

List<Issue> findByStatusLessThanEqualToInAvailableProjects(int maxStatus)
Finds all issues with a status less than or equal to the given status in active and viewable projects.

Parameters:
maxStatus - all issues less that or equal to this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

findBySeverity

List<Issue> findBySeverity(int severity)
Finds all issues with the given severity in all projects.

Parameters:
severity - severity of the issues to return
Returns:
list of issues matching the above filter, in an unspecified order

findByProject

List<Issue> findByProject(Integer projectId)
Finds all issues of the given project.

Parameters:
projectId - ID of the project of which to retrieve all issues
Returns:
list of issues in no particular order

countByProject

Long countByProject(Integer projectId)
Counts the number of issues of the given project.

Parameters:
projectId - ID of the project of which to count issues
Returns:
number of issues

findByProjectAndLowerStatus

List<Issue> findByProjectAndLowerStatus(Integer projectId,
                                        int maxExclusiveStatus)
Finds all issues of the given project with a status lower than the given one.

Parameters:
projectId - ID of the project of which to retrieve the issues
maxExclusiveStatus - all issues under this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

countByProjectAndLowerStatus

Long countByProjectAndLowerStatus(Integer projectId,
                                  int maxExclusiveStatus)
Counts the number of issues of the given project with a status lower than the given one.

Parameters:
projectId - ID of the project of which to count issues
maxExclusiveStatus - all issues under this status will be counted
Returns:
number of issues

findByProjectAndHigherStatus

List<Issue> findByProjectAndHigherStatus(Integer projectId,
                                         int minStatus)
Finds all issues of the given project with a status higher than or equal to the given one.

Parameters:
projectId - ID of the project of which to retrieve the issues
minStatus - all issues with this status or above will be returned
Returns:
list of issues matching the above filter, in an unspecified order

countByProjectAndHigherStatus

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.

Parameters:
projectId - ID of the project of which to count issues
minStatus - all issues with this status or above will be counted
Returns:
number of issues

findByOwner

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.

Parameters:
ownerId - ID of the user who owns the issues to return
maxExclusiveStatus - status under which to return issues
Returns:
list of issues matching the above filter, in an unspecified order

findByOwnerInAvailableProjects

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.

Parameters:
ownerId - ID of the user who owns the issues to return
maxExclusiveStatus - status under which to return issues
Returns:
list of issues matching the above filter, in an unspecified order

findUnassignedIssues

List<Issue> findUnassignedIssues(int maxStatus)
Finds all issues without owner with a status less than or equal to the given one in all projects.

Parameters:
maxStatus - maximum status allowed for the issues to return
Returns:
list of issues matching the above filter, in an unspecified order

findByCreator

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.

Parameters:
userId - ID of the user who created the issues to return
maxExclusiveStatus - all issues under this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

findByCreatorInAvailableProjects

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.

Parameters:
userId - ID of the user who created the issues to return
maxExclusiveStatus - all issues under this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

findByNotification

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.

Only 1 instance of every issue is returned, even if multiple notifications exist for an issue.

Parameters:
userId - ID of the user with notifications for the issues to return
maxExclusiveStatus - all issues under this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

findByNotificationInAvailableProjects

List<Issue> findByNotificationInAvailableProjects(Integer userId,
                                                  int maxExclusiveStatus)
Finds all issues with notifications for the given user in active and viewable projects.

Only 1 instance of every issue is returned, even if multiple notifications exist for an issue.

Parameters:
userId - ID of the user with notifications for the issues to return
maxExclusiveStatus - all issues under this status will be returned
Returns:
list of issues matching the above filter, in an unspecified order

findByComponent

List<Issue> findByComponent(Integer componentId)
Finds all issues of the component with the given ID.

Parameters:
componentId - ID of the component of which to retrieve all issues
Returns:
list of issues in no particular order

countAllIssues

Long countAllIssues()
Count all Issues in database

Returns:

countByComponent

Long countByComponent(Integer componentId)
Counts the number of issues attached to a component.

Parameters:
componentId - ID of the component
Returns:
number of issues

findByVersion

List<Issue> findByVersion(Integer versionId)
Finds all issues of the version with the given ID.

Parameters:
versionId - ID of the version of which to retrieve all issues
Returns:
list of issues in no particular order

countByVersion

Long countByVersion(Integer versionId)
Counts the number of issues attached to a version.

Parameters:
versionId - ID of the version
Returns:
number of issues

latestModificationDate

Date latestModificationDate(Integer projectId)
Returns the modification date of the latest modified issue in the project with the given id.

Parameters:
projectId - ID of the project of which to retrieve the issues
Returns:
date of the most recent issue modification for the project. null if no issue exists in the project

query

List<Issue> query(IssueSearchQuery queryModel,
                  User user,
                  Map<Integer,Set<PermissionType>> userPermissions)
Query the list of issues that satisfies the search criteria specified in queryModel.

Parameters:
queryModel - 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.
Returns:

findByTargetVersion

List<Issue> findByTargetVersion(Integer versionId)
Delete all issues targeted for the specified version.

Parameters:
versionId - the version ID.


Copyright © 2002-2012 itracker. All Rights Reserved.