Composition Test 1
This commit is contained in:
parent
b7716b980b
commit
097e5d1f01
@ -6,6 +6,7 @@ import com.example.demo.model.test_db.Tables.MESSAGES
|
||||
import com.example.demo.model.test_db.tables.Users.USERS
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.asFlow
|
||||
import org.jooq.Condition
|
||||
import org.jooq.DSLContext
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.context.annotation.Lazy
|
||||
@ -45,5 +46,15 @@ class UserService(@Autowired @Lazy private val dsl: DSLContext) {
|
||||
.map { it.get(MESSAGES.MESSAGE) }
|
||||
.asFlow()
|
||||
|
||||
fun test() = dsl
|
||||
.select(Query.messages)
|
||||
.from(MESSAGES)
|
||||
.where(Query.complexClause)
|
||||
.fetch()
|
||||
.asFlow()
|
||||
|
||||
private object Query {
|
||||
val messages = listOf(MESSAGES.MESSAGE)
|
||||
val complexClause: Condition = MESSAGES.MESSAGE.eq("")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user