src/main/java/de/uapcore/lightpit/dao/IssueDao.java

Sat, 24 Oct 2020 12:09:08 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 24 Oct 2020 12:09:08 +0200
changeset 151
b3f14cd4f3ab
parent 150
822b7e3d064d
permissions
-rw-r--r--

migrate DataSourceProvider

universe@38 1 /*
universe@38 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@38 3 *
universe@38 4 * Copyright 2018 Mike Becker. All rights reserved.
universe@38 5 *
universe@38 6 * Redistribution and use in source and binary forms, with or without
universe@38 7 * modification, are permitted provided that the following conditions are met:
universe@38 8 *
universe@38 9 * 1. Redistributions of source code must retain the above copyright
universe@38 10 * notice, this list of conditions and the following disclaimer.
universe@38 11 *
universe@38 12 * 2. Redistributions in binary form must reproduce the above copyright
universe@38 13 * notice, this list of conditions and the following disclaimer in the
universe@38 14 * documentation and/or other materials provided with the distribution.
universe@38 15 *
universe@38 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@38 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@38 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
universe@38 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
universe@38 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
universe@38 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
universe@38 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
universe@38 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
universe@38 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
universe@38 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
universe@38 26 * POSSIBILITY OF SUCH DAMAGE.
universe@38 27 *
universe@38 28 */
universe@38 29 package de.uapcore.lightpit.dao;
universe@38 30
universe@134 31 import de.uapcore.lightpit.entities.*;
universe@38 32
universe@59 33 import java.sql.SQLException;
universe@59 34 import java.util.List;
universe@59 35
universe@128 36 public interface IssueDao extends ChildEntityDao<Issue, Project> {
universe@75 37
universe@75 38 /**
universe@134 39 * Lists all issues that are related to the specified component and version.
universe@134 40 * If component or version is null, search for issues that are not assigned to any
universe@134 41 * component or version, respectively.
universe@86 42 *
universe@134 43 * @param project the project
universe@134 44 * @param component the component or null
universe@105 45 * @param version the version or null
universe@86 46 * @return a list of issues
universe@86 47 * @throws SQLException on any kind of SQL error
universe@86 48 */
universe@134 49 List<Issue> list(Project project, Component component, Version version) throws SQLException;
universe@134 50
universe@134 51 /**
universe@134 52 * Lists all issues that are related to the specified version.
universe@134 53 * If the version is null, lists issues that are not assigned to any version.
universe@134 54 *
universe@134 55 * @param project the project (mandatory)
universe@134 56 * @param version the version or null
universe@134 57 * @return a list of issues
universe@134 58 * @throws SQLException on any kind of SQL error
universe@134 59 */
universe@134 60 List<Issue> list(Project project, Version version) throws SQLException;
universe@134 61
universe@134 62 /**
universe@134 63 * Lists all issues that are related to the specified component.
universe@134 64 * If the component is null, lists issues that are not assigned to a component.
universe@134 65 *
universe@134 66 * @param project the project (mandatory)
universe@134 67 * @param component the component or null
universe@134 68 * @return a list of issues
universe@134 69 * @throws SQLException on any kind of SQL error
universe@134 70 */
universe@134 71 List<Issue> list(Project project, Component component) throws SQLException;
universe@86 72
universe@86 73 /**
universe@124 74 * Lists all comments for a specific issue in chronological order.
universe@124 75 *
universe@124 76 * @param issue the issue
universe@124 77 * @return the list of comments
universe@124 78 * @throws SQLException on any kind of SQL error
universe@124 79 */
universe@124 80 List<IssueComment> listComments(Issue issue) throws SQLException;
universe@124 81
universe@124 82 /**
universe@124 83 * Stores the specified comment in database.
universe@124 84 * This is an update-or-insert operation.
universe@124 85 *
universe@150 86 * @param issue the issue to save the comment for
universe@124 87 * @param comment the comment to save
universe@124 88 * @throws SQLException on any kind of SQL error
universe@124 89 */
universe@150 90 void saveComment(Issue issue, IssueComment comment) throws SQLException;
universe@124 91
universe@124 92 /**
universe@75 93 * Saves an instances to the database.
universe@75 94 * Implementations of this DAO must guarantee that the generated ID is stored in the instance.
universe@75 95 *
universe@75 96 * @param instance the instance to insert
universe@128 97 * @param project the parent project
universe@75 98 * @throws SQLException on any kind of SQL error
universe@75 99 * @see Issue#setId(int)
universe@75 100 */
universe@75 101 @Override
universe@128 102 void save(Issue instance, Project project) throws SQLException;
universe@75 103
universe@75 104 /**
universe@75 105 * Retrieves the affected, scheduled and resolved versions for the specified issue.
universe@75 106 *
universe@75 107 * @param issue the issue to join the information for
universe@75 108 * @throws SQLException on any kind of SQL error
universe@75 109 */
universe@75 110 void joinVersionInformation(Issue issue) throws SQLException;
universe@38 111 }

mercurial