mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-05-18 06:24:12 +02:00
feat(connector): create a database transaction class for Project
This commit is contained in:
parent
bf31232d92
commit
ac986abcb3
@ -0,0 +1,27 @@
|
||||
package io.anthonyberg.connector.shared
|
||||
|
||||
import io.anthonyberg.connector.shared.database.DriverFactory
|
||||
import io.anthonyberg.connector.shared.database.ProjectDatabase
|
||||
import io.anthonyberg.connector.shared.entity.Project
|
||||
|
||||
/**
|
||||
* All database transactions for Project
|
||||
*/
|
||||
class ProjectTransaction (driverFactory: DriverFactory) {
|
||||
private val database = ProjectDatabase(driverFactory)
|
||||
|
||||
/**
|
||||
* Gets all Projects in the database.
|
||||
*/
|
||||
fun getProjects(): List<Project> {
|
||||
val projects = database.getAllProjects()
|
||||
return projects
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a project in the database.
|
||||
*/
|
||||
fun createProject(project: Project) {
|
||||
database.createProject(project)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user