objectbox / objectbox/objectbox-java

How to listen to the first of ToMany

Aperta
#568 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@greenrobot-team ci sta già lavorando.

Dal 1/10/2018.

enhancement
Lingua principale
Java
Stelle
4.6k
Fork
311
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

@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>
}

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.