objectbox-java icon indicating copy to clipboard operation
objectbox-java copied to clipboard

Observing a property or PropertyQuery

Open tvvbbb opened this issue 6 years ago • 4 comments

Using ObjectBoxLiveData to observer one property?

tvvbbb avatar Aug 16 '18 08:08 tvvbbb

I'm not sure what you want.

Are you talking about observing a PropertyQuery? This is not supported.

Are you talking about returning only a single property in Observer.onChanged()? No, this is not possible with ObjectBoxLiveData.

Anyhow, you can access the properties you want in your Observer.onChanged()? Or write your own LiveData that does what you want. -ut

greenrobot-team avatar Aug 20 '18 13:08 greenrobot-team

This is what I want to know. Thanks. Why can't do this?

tvvbbb avatar Aug 21 '18 03:08 tvvbbb

As I explained above,

  • observing PropertyQuery is not supported and
  • ObjectBoxLiveData is tailored to return a list of entities, like a Query.

Which one of those do you need? We can keep this ticket open as a feature request then. -ut

greenrobot-team avatar Aug 21 '18 08:08 greenrobot-team

Both observing PropertyQuery and return only a single property in Observer.onChanged() are needed. I hope it will appear in the future.

tvvbbb avatar Aug 21 '18 08:08 tvvbbb