Skip to content

How to listen to the first of ToMany #568

@TinoGuo

Description

@TinoGuo
@Entity
class Session {
    @Id
    var id: Long = 0
    
    lateinit var messages: ToMany<Message>
}

In my app, there is a session list, we need to listen to the first of messages, but now I can't find any direct method to listen.

My question: Is there any simple workaround to listen?
BTW, now I need to add a extra field latestContent to solve this problem. Just as below.

@Entity
class Session {
    @Id
    var id: Long = 0

    //when update messages, update this field
    lateinit var latestContent: String
    
    lateinit var messages: ToMany<Message>
}

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions