Mapper.xml can support the dynamic creation of SQL, but is there a better way to use it? For example, creating SQL using a DSL? ``` package top.rish; import java.util.List;
import static top.rish.Order.ORDER;
import static top.rish.User.USER;
import static top.rish.jsql.dsl.Dsl.*;
public class Ztest {
public static void main(String[] args) {
List
select * from user as u left join order as o on u.id = o.user_id where u.id = 1 order by u.id desc group by u.id limit 0 , 10
Comment From: itdoer
If you implement orm using DSL,mybatis will really be perfect
Comment From: itdoer
This is just an example of what I've done by hand, and the idea behind it, to you, should be fairly simple, but the object relational mapping behind it is more central, so why not try a DSL?
Comment From: harawata
Hi @itdoer , Check out https://github.com/mybatis/mybatis-dynamic-sql
Comment From: harawata
No response.