src/main/kotlin/de/uapcore/lightpit/dao/DataAccessObject.kt

Mon, 21 Dec 2020 18:29:34 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 21 Dec 2020 18:29:34 +0100
changeset 167
3f30adba1c63
parent 159
src/main/kotlin/de/uapcore/lightpit/dao/DaoProvider.kt@86b5d8a1662f
child 180
009700915269
permissions
-rw-r--r--

major refactoring of DAO architecture - also fixes #114

mike@159 1 /*
mike@159 2 * Copyright 2020 Mike Becker. All rights reserved.
mike@159 3 *
mike@159 4 * Redistribution and use in source and binary forms, with or without
mike@159 5 * modification, are permitted provided that the following conditions are met:
mike@159 6 *
mike@159 7 * 1. Redistributions of source code must retain the above copyright
mike@159 8 * notice, this list of conditions and the following disclaimer.
mike@159 9 *
mike@159 10 * 2. Redistributions in binary form must reproduce the above copyright
mike@159 11 * notice, this list of conditions and the following disclaimer in the
mike@159 12 * documentation and/or other materials provided with the distribution.
mike@159 13 *
mike@159 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mike@159 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mike@159 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mike@159 17 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mike@159 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mike@159 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mike@159 20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mike@159 21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mike@159 22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mike@159 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mike@159 24 */
mike@159 25
mike@159 26 package de.uapcore.lightpit.dao
mike@159 27
universe@167 28 import de.uapcore.lightpit.entities.*
universe@167 29 import de.uapcore.lightpit.filter.IssueFilter
universe@167 30
universe@167 31 interface DataAccessObject {
universe@167 32 fun listUsers(): List<User>
universe@167 33 fun findUser(id: Int): User?
universe@167 34 fun findUserByName(username: String): User?
universe@167 35 fun insertUser(user: User)
universe@167 36 fun updateUser(user: User)
universe@167 37
universe@167 38 fun listVersions(project: Project): List<Version>
universe@167 39 fun findVersion(id: Int): Version?
universe@167 40 fun findVersionByNode(project: Project, node: String): Version?
universe@167 41 fun insertVersion(version: Version)
universe@167 42 fun updateVersion(version: Version)
universe@167 43
universe@167 44 fun listComponents(project: Project): List<Component>
universe@167 45 fun findComponent(id: Int): Component?
universe@167 46 fun findComponentByNode(project: Project, node: String): Component?
universe@167 47 fun insertComponent(component: Component)
universe@167 48 fun updateComponent(component: Component)
universe@167 49
universe@167 50 fun listProjects(): List<Project>
universe@167 51 fun findProject(id: Int): Project?
universe@167 52 fun findProjectByNode(node: String): Project?
universe@167 53 fun insertProject(project: Project)
universe@167 54 fun updateProject(project: Project)
universe@167 55
universe@167 56 fun collectIssueSummary(project: Project): IssueSummary
universe@167 57
universe@167 58 fun listIssues(filter: IssueFilter): List<Issue>
universe@167 59 fun findIssue(id: Int): Issue?
universe@167 60 fun insertIssue(issue: Issue)
universe@167 61 fun updateIssue(issue: Issue)
universe@167 62
universe@167 63 fun listComments(issue: Issue): List<IssueComment>
universe@167 64 fun insertComment(issueComment: IssueComment)
mike@159 65 }

mercurial