{"repo":"x-ream/sqli","free":true,"listed":false,"github":"https://github.com/x-ream/sqli","clone":"git clone https://github.com/x-ream/sqli.git","description":"orm sql query builder, API: QB, QB.X, QrB","language":"Java","stars":1713,"topics":["xream","orm","jdbc","mysql","impala","clickhouse","presto","tdengine","query-builder"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"sqli 简单的SQL拼写 http://sqli.xream.io WIKI sqli/sqli-builder sqli/sqli-core sqli/sqli-dialect sqli/sqli-repo sqli-repo 使用方法 sqli仅仅是SQL的编程接口,需要整合到已有的框架或项目中, 在io.xream.x7项目里实现了和Spring-Boot/Spring-JdbcTemplate的整合 @EnableX7Repostory // code at x7/x7-spring-boot-starter public class App{ main() .... } 更多代码片段: @Repository public interface FooRepository extends BaseRepository {} @Repository public interface BarRepository extends RepositoryX {} @X.Mapping(\"t foo\")//默认是foo public class Foo { @X.Key //不指定主键的情况下，不支持根据get(id),remove(id) private Long id; @X.Mapping(\"full name\") //默认是fullName private String fullName; } @Service public class FooServiceImpl implements FooService { @Autowired private FooRepository fooRepository; @Autowired private FooFindRepository fooFindRepository; // 临时表, 原生SQL, 则直接注入, 不支持代理 @Autowired private TemporaryRepository temporaryRepository; @Autowired private NativeRepository nativeRepository; BaseRepository API 1. in(property, inList) //in查询, 例如: 页面上需要的主表ID或记录已经查出后，补充查询其他表的文本说明数据时使用 2. find(q) //标准拼接查询，返回对象形式记录，返回分页对象 3. list(q) //标准拼接查询，返回对象形式记录，不返回分页对象 4. get(Id) //根据主键查询记录 5. getOne(q) //数据库只有一条记录时，就返回那条记录 6. creaet(Object) //插入一条, 不支持返回自增键, 框架自带ID生成器 7. createOrReplace(Object) //插入或替换一条 8. createBatch(List ) //批量插入 9. refresh( qr) //根据主键更新 10. refreshUnSafe( qr)//不根据主键更新 11. remove(Id)//根据主键删除 12. removeRefreshCreate(RemoveRefreshCreate ) //编辑页面列表时写数据库 RepositoryX API 13. find(xq) //标准拼接查询，返回Map形式记录，返回分页对象 14. list(xq) //标准拼接查询，返回Map形式记录，不返回分页对象 15. listPlainVa","default_branch":null,"files":null,"tree":[],"storefront":"/r/x-ream","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/x-ream/sqli/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}