-
Notifications
You must be signed in to change notification settings - Fork 306
Closed
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Is there a way for an observable query to detect when a related entity changes, and notify its subscribers? The following uses a one-to-one relationship between a person and an address. I would like the person query to be notified when a person's address changes.
@Entity
data class Person(@Id val id: Long = 0) {
lateinit var homeAddress: ToOne<Address>
}
@Entity
data class Address(@Id var id: Long = 0,
val street: String
)
// Build a query for the parent
val query = boxStore.boxFor<Person>().query().build()
query.find()
// I want to be notified when the address changes
query.subscribe(...)
// Update the relationship
person.homeAddress.target = Address(street= "...")
boxStore.boxFor<Address>.put(newAddress) // persists, but the person query does not get notified
This updates the address box as expected, but the person query is not notified. Any way to accomplish that?
Ekalips, squeeish, jrcacd, yt-tkhs, amgadserry and 5 more
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists