• d

    ddsoyka

    5 years ago
    Does Exposed support one-to-many relationships?
    d
    1 replies
    Copy to Clipboard
  • d

    ddsoyka

    5 years ago
    To be more specific, will the
    posts
    property of the
    Thread
    class contain only elements that I add to it, or is it a reference to the
    Posts
    table and all of it's rows?
    d
    1 replies
    Copy to Clipboard
  • tapac

    tapac

    5 years ago
  • z

    ziad

    4 years ago
    Thanks for the advice, Andrey. I did it with a slight modification (because insertAndGetId was an unresolved reference)
    val userId = Users.select {
                    Users.deviceId eq requestDeviceId
                }.map { it[Users.id] }.singleOrNull() ?: Users.insert {
                    it[deviceId] = requestDeviceId
                } get Users.id
    z
    1 replies
    Copy to Clipboard
  • tapac

    tapac

    4 years ago
    @pastjean, it’s not supported right now, but you can find workaround in comments here https://github.com/JetBrains/Exposed/issues/93
    tapac
    1 replies
    Copy to Clipboard
  • n

    nekoinemo

    4 years ago
    Hello. Is there a way to use id value directly in Table operations if i went with DAO's EntityId<*> approach? In other words, how can i use, say, Long value to select from table if i declared table as LongIdTable?
    n
    tapac
    2 replies
    Copy to Clipboard
  • oshai

    oshai

    4 years ago
    @tapac - I am getting the following error
    java.lang.IllegalStateException: can't find primary key of type Int or Long; map['com.outbrain.oen.services.oendblib.dao.ocas.OenCampaignStatusTable.ocas_id']='75191' (where map='{com.outbrain.oen.services.oendblib.dao.ocas.OenCampaignStatusTable.ocas_id=75191}')
    oshai
    tapac
    15 replies
    Copy to Clipboard
  • tapac

    tapac

    4 years ago
    Exposed doesn't support coroutines yet. Can you share your use-cases of how you going to use it? Should new short transaction be created for every async block? I hope you understand that you can't share same transaction for couroutines or it became synchronous code.
    tapac
    u
    4 replies
    Copy to Clipboard
  • tapac

    tapac

    4 years ago
    @wouterdoeland, could you provide code sample ?
    tapac
    w
    5 replies
    Copy to Clipboard
  • oshai

    oshai

    4 years ago
    let me know if that looks ok: https://github.com/JetBrains/Exposed/wiki/DAO
    oshai
    tapac
    +1
    3 replies
    Copy to Clipboard