private static final long serialVersionUID = -7601747238335476406L;
private String id;
private String title;
private String description;
private String teachers;
private String classify;
//getter and setter
}
public abstract class CourseQueryBasic extends Query {
private String queryId;
private String queryTitle;
//getter and setter
}
**扩展对象**
public class CourseResult extends Course{
private static final long serialVersionUID = 1954492459158028325L;
private int courseLength;
public int getCourseLength() {
return courseLength;
}
public void setCourseLength(int courseLength) {
this.courseLength = courseLength;
}
}
public class CourseQuery extends CourseQueryBasic {
扩展方案说明
重新定义代码结构
分层扩展结构
数据层
Mybatis xml实现方式
产品XML
扩展XML
产品对象
} public abstract class CourseQueryBasic extends Query {
}
public class CourseResult extends Course{ private static final long serialVersionUID = 1954492459158028325L; private int courseLength; public int getCourseLength() { return courseLength; } public void setCourseLength(int courseLength) { this.courseLength = courseLength; } } public class CourseQuery extends CourseQueryBasic {
}