Skip to content

Commit

Permalink
♻️ Use method .selectFrom instead of specifying all the table fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysoun committed Mar 5, 2024
1 parent 68ddd53 commit 951499e
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ class ModuleEnvironmentTokenDao(val dslContext: DSLContext) : ModuleEnvironmentT
?.into(ModuleEnvironmentToken::class.java)

override fun getTokenByModuleAndEnvironmentRef(moduleRef: UUID, environmentRef: UUID): ModuleEnvironmentToken? =
dslContext.select(
DM_MODULE_DM_ENVIRONMENT_TOKEN.TOKEN_VALUE,
DM_MODULE_DM_ENVIRONMENT_TOKEN.FK_MODULE_REF,
DM_MODULE_DM_ENVIRONMENT_TOKEN.FK_ENVIRONMENT_REF,
)
.from(DM_MODULE_DM_ENVIRONMENT_TOKEN)
.where(
DM_MODULE_DM_ENVIRONMENT_TOKEN.FK_MODULE_REF.eq(moduleRef)
dslContext.selectFrom(DM_MODULE_DM_ENVIRONMENT_TOKEN)
.where(DM_MODULE_DM_ENVIRONMENT_TOKEN.FK_MODULE_REF.eq(moduleRef)
.and(DM_MODULE_DM_ENVIRONMENT_TOKEN.FK_ENVIRONMENT_REF.eq(environmentRef))
)
.fetchOneInto(ModuleEnvironmentToken::class.java)
Expand Down

0 comments on commit 951499e

Please sign in to comment.