Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make meta properties accessible via static methods from the entity instance #562

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leslmosnk
Copy link

@leslmosnk leslmosnk commented Sep 21, 2023

static mebers can be called from an instance of class with ObjectBox queries.

@greenrobot-team
Copy link
Member

Thanks! However, I don't really see why this is needed. Can you explain how this is useful to you?

@greenrobot-team greenrobot-team added more info required Needs more info to become actionable. Auto-closed if no response. enhancement New feature or request labels Oct 9, 2023
@leslmosnk
Copy link
Author

Thanks! However, I don't really see why this is needed. Can you explain how this is useful to you?

This way I managed to extend Object with Object_. So I can easily call a query parameter from an instance of Object.

(I later found out export 'objectbox.g.dart' show Object_ is enough for my purposes)

@greenrobot-team
Copy link
Member

But why can't the Object_ fields be used in your case? We chose explicitly not to add them to the model class to keep it clean (e.g. to avoid any conflicts with existing code).

@leslmosnk
Copy link
Author

Its very possible to use Object_, but I feel like it only used whenever I also use my Object. So i'd rather have a static in Object that would hold my queries instead of having to import and call Object_ every time.

@greenrobot-team greenrobot-team removed the more info required Needs more info to become actionable. Auto-closed if no response. label Oct 16, 2023
@greenrobot-team greenrobot-team changed the title static methods can be called from an instance Make meta properties accessible via static methods from the entity instance Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants