Browse Source

Composition Test 1

master
nova 4 years ago
parent
commit
097e5d1f01
  1. 11
      src/main/kotlin/com/example/demo/service/UserService.kt

11
src/main/kotlin/com/example/demo/service/UserService.kt

@ -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…
Cancel
Save