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

[Question] HiveField 0 - 255 exclusive to one class? #16

Closed
madqueendany opened this issue Aug 15, 2019 · 2 comments
Closed

[Question] HiveField 0 - 255 exclusive to one class? #16

madqueendany opened this issue Aug 15, 2019 · 2 comments

Comments

@madqueendany
Copy link

In the example, if I want to register a class to a HiveType, I'd have to put @HiveField(n) to the fields that I want to store, right?

@HiveType()
class Dog {
  @HiveField(0)
  String name;

  @HiveField(1)
  int age;

  @HiveField(2)
  List<Person> friends;
}

What if I have another class that I want to store, like Cat?

@HiveType()
class Cat {
  @HiveField(3)
  String name;

  @HiveField(4)
  int age;

  @HiveField(5)
  List<Person> friends;
}

should the numbering continue, or it goes back to zero?

@simc
Copy link
Member

simc commented Aug 15, 2019

Yes, you should start at 0 for each class. I'll clarify the documentation and close this issue when it is done.

@madqueendany
Copy link
Author

Great. Tried it out as well. It can go back to zero.

Thanks so far so good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants