话说没人用过 doma 么...支持模板与 dsl
val list = entityql
.from(e)
.innerJoin(d) { eq(e.departmentId, d.departmentId) }
.where { eq(d.departmentName, "SALES") }
.associate(e, d) { employee, department ->
employee.department = department
department.employeeList += employee
}
.fetch()
@
Daopublic interface EmployeeDao {
@
Sql(
"""
select * from EMPLOYEE where
/*%if salary != null*/
SALARY >= /*salary*/9999
/*%end*/
""")
@
Select List<Employee> selectBySalary(BigDecimal salary);
}