-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made BackendPipeline a little cleaner and moved inserts into services
- Loading branch information
1 parent
9a4bc45
commit 80b5f23
Showing
4 changed files
with
74 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
smojol-api/src/main/java/org/smojol/api/ProjectService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.smojol.api; | ||
|
||
import org.jooq.DSLContext; | ||
import org.jooq.Record; | ||
import org.jooq.Table; | ||
|
||
import static org.jooq.impl.DSL.field; | ||
import static org.jooq.impl.DSL.table; | ||
|
||
public class ProjectService { | ||
Table<Record> PROJECT = table("PROJECT"); | ||
|
||
public long insertProject(String projectName, DSLContext using) { | ||
Long into = using.insertInto(PROJECT) | ||
.columns(field("NAME")) | ||
.values(projectName) | ||
.returningResult(field("ID", Long.class)) | ||
.fetchOne() | ||
.into(Long.class); | ||
return into; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters