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

Should support inherited classes #178

Open
andredealmei opened this issue Mar 19, 2020 · 0 comments
Open

Should support inherited classes #178

andredealmei opened this issue Mar 19, 2020 · 0 comments

Comments

@andredealmei
Copy link

My entities share common columns:

abstract class WithUpdate {
  @Column(isNullable: true)
  DateTime updatedAt;
}

When inheriting from the above class:

class SomeEntity extends WithUpdate {
  @PrimaryKey()
  int id;
}

code generation not generate fields from abstract class;

gen code:

abstract class _SomeEntityBean implements Bean<SomeEntity> {
  final id = IntField('id');
  Map<String, Field> _fields;
  Map<String, Field> get fields => _fields ??= {
        id.name: id,
      };
  SomeEntity fromMap(Map map) {
    SomeEntity model = SomeEntity();
    model.id = adapter.parseValue(map['id']);

    return model;
  }

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

1 participant