jaguar_orm icon indicating copy to clipboard operation
jaguar_orm copied to clipboard

Should support inherited classes

Open andredealmei opened this issue 4 years ago • 0 comments

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;
  }

andredealmei avatar Mar 19 '20 19:03 andredealmei