question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support data observers for related entities

See original GitHub issue

This might be a feature request. It seems that currently it is not possible to listen for nested changes.

  • ObjectBox version: 1.2.1
  • Reproducibility: always
boxFor(Item::class.java).query().build().subscribe().observer { items ->
    // Not called when Note.text changes.
}

Entities

@Entity
class Item {

    @Id
    open var id: Long = 0L

    lateinit open var notes: ToMany<Note>
}
@Entity
class Note {

    @Id
    open var id: Long = 0L

    open var text: String? = null

    @Backlink
    lateinit open var parentItem: ToOne<Item>
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:9
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
greenrobotcommented, Nov 22, 2017

I thought we have tracked that already, but did not find it…

1reaction
jpmcostacommented, Nov 21, 2017

I think the following code could also trigger changes in data observers:

item.notes.add(Note())
item.notes.applyChangesToDb()
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to: Implement an Observer | Microsoft Learn
The observer design pattern requires a division between an observer, which registers for notifications, and a provider, which monitors data and ...
Read more >
How Do We Use Observer Data? - NOAA Fisheries
Observer data provide unique and independent information, collected at sea, ... These data support sustainable fisheries and protected species recovery.
Read more >
entt::basic_observer< Entity > Class Template Reference
An observer returns all the entities and only the entities that fit the requirements of at least one matcher. Moreover, it's guaranteed that...
Read more >
LiveData overview - Android Developers
Use LiveData to handle data in a lifecycle-aware fashion. ... Note: You can register an observer without an associated LifecycleOwner object ...
Read more >
Observer Data Usage
October 2012: Please view APO comments on the proposed rule on the confidentiality of observer information. View here the comments of others and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found