mike@159: /* mike@159: * Copyright 2020 Mike Becker. All rights reserved. mike@159: * mike@159: * Redistribution and use in source and binary forms, with or without mike@159: * modification, are permitted provided that the following conditions are met: mike@159: * mike@159: * 1. Redistributions of source code must retain the above copyright mike@159: * notice, this list of conditions and the following disclaimer. mike@159: * mike@159: * 2. Redistributions in binary form must reproduce the above copyright mike@159: * notice, this list of conditions and the following disclaimer in the mike@159: * documentation and/or other materials provided with the distribution. mike@159: * mike@159: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" mike@159: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE mike@159: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE mike@159: * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE mike@159: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL mike@159: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR mike@159: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER mike@159: * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, mike@159: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE mike@159: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. mike@159: * mike@159: */ mike@159: mike@159: package de.uapcore.lightpit.dao mike@159: mike@159: import de.uapcore.lightpit.entities.* mike@159: import java.sql.SQLException mike@159: mike@159: abstract class AbstractIssueDao : AbstractChildEntityDao() { mike@159: mike@159: /** mike@159: * Lists all issues that are related to the specified component and version. mike@159: * If component or version is null, search for issues that are not assigned to any mike@159: * component or version, respectively. mike@159: * mike@159: * @param project the project mike@159: * @param component the component mike@159: * @param version the version mike@159: * @return a list of issues mike@159: */ mike@159: abstract fun list(project: Project, component: Component?, version: Version?): List mike@159: mike@159: /** mike@159: * Lists all issues that are related to the specified version. mike@159: * If the version is null, lists issues that are not assigned to any version. mike@159: * mike@159: * @param project the project mike@159: * @param version the version or null mike@159: * @return a list of issues mike@159: */ mike@159: abstract fun list(project: Project, version: Version?): List mike@159: mike@159: /** mike@159: * Lists all issues that are related to the specified component. mike@159: * If the component is null, lists issues that are not assigned to a component. mike@159: * mike@159: * @param project the project mike@159: * @param component the component or null mike@159: * @return a list of issues mike@159: */ mike@159: abstract fun list(project: Project, component: Component?): List mike@159: mike@159: /** mike@159: * Lists all comments for a specific issue in chronological order. mike@159: * mike@159: * @param issue the issue mike@159: * @return the list of comments mike@159: */ mike@159: abstract fun listComments(issue: Issue): List mike@159: mike@159: /** mike@159: * Stores the specified comment in database. mike@159: * This is an update-or-insert operation. universe@164: * The "updated" date of the corresponding issue is also updated. mike@159: * mike@159: * @param issue the issue to save the comment for mike@159: * @param comment the comment to save mike@159: */ mike@159: abstract fun saveComment(issue: Issue, comment: IssueComment) mike@159: mike@159: /** mike@159: * Saves an instances to the database. mike@159: * Implementations of this DAO must guarantee that the generated ID is stored in the instance. mike@159: * mike@159: * @param instance the instance to insert mike@159: * @param parent the parent project mike@159: * @throws SQLException on any kind of SQL error mike@159: */ mike@159: abstract override fun save(instance: Issue, parent: Project) mike@159: mike@159: /** mike@159: * Retrieves the affected, scheduled and resolved versions for the specified issue. mike@159: * mike@159: * @param issue the issue to join the information for mike@159: */ mike@159: abstract fun joinVersionInformation(issue: Issue) mike@159: }