An abstract model gets no table of its own. Its columns, and any
@PrimaryKey / @Default / validation applied to them, are inherited by the
concrete models that extend it, so shared fields are declared once:
// This is the base model, which defines the common fields between all comments. @AbstractModel() classBaseComment { @Column(DataTypes.INTEGER()) @PrimaryKey() @AutoIncrement() declareid: number;
Mark a class as an abstract base model.
An abstract model gets no table of its own. Its columns, and any
@PrimaryKey/@Default/ validation applied to them, are inherited by the concrete models that extend it, so shared fields are declared once:PostCommentis created with id, body and postId. Passing the abstract class itself toaddModel()is an error - there is no table to address.