数据库映射model:
@Table("users")
public class User{
@Column
private String name;
@Column("teacher_id")
private String teacherId;
}
自定义dto:
public class UserDTO extends User{
private String teacherName
}
查询语句,自定义sql:select a.*,b.name as teacher_name from users a left join teacher b on a.teacher_id =b.id
查询:
Sql sql = Sqls.create("...");
....
这里的查询如何映射到UserDTO这个pojo类了