- 继承Model当然需要先看一下Model的代码
public abstract class Model<M extends Model> implements Serializable { ... }
- 发现Model的泛型有继承关系,那么子类如下写
public class BaseModel<M extends BaseModel<M>> extends Model<M> { ... }
- 大功告成
public class User extends BaseModel<User > { ... }