Thread
#exposed
    p

    paulex

    2 years ago
    override fun modify(item: User): CompletionStage<User> {
        return supplyAsync {
            transaction {
                Users.update({ Users.id eq item.id }) {
                    it[name] = item.name
                    it[gender] = item.gender
                    it[first_name] = item.firstName;
                }
            }
        }.thenApply { return@thenApply item }
    }
    Is there a way to simplify an update transaction on object properties, i feel it is repetitive to keep on writing : it[name] = item.name it[gender] = item.gender ?
    a

    adamd

    2 years ago
    s

    spand

    2 years ago
    I think you want to use https://github.com/JetBrains/Exposed#dao-sample instead of the DSL variant
    p

    paulex

    2 years ago
    @adamd Thanks, i think that library solves the problem i explained, however i'm currently not keen on using a library for this at the moment, but it's worth knowing there is a library that solves this. Thanks