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 68103aa
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package dao.moduleEnvironmentToken

import generated.domain.tables.references.DM_MODULE
import generated.domain.tables.references.DM_MODULE_DM_ENVIRONMENT_TOKEN
import module.Module
import moduleEnvironmentToken.ModuleEnvironmentToken
import moduleEnvironmentToken.ModuleEnvironmentTokenCreationRequest
import moduleEnvironmentToken.ModuleEnvironmentTokenDaoInterface
Expand All @@ -27,12 +25,7 @@ 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)
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))
Expand Down

0 comments on commit 68103aa

Please sign in to comment.