更新內容
1、主要增加對國產達夢資料庫的支持(目前除updateFetch:單次交互完成鎖記錄、修改、返回結果報遊標錯誤外其他功能都通過測試)
2、修復因增加oceanBase方言導致sqlite方言未放入方言池中產生的bug
3、增加findEntity分頁功能,便於單表查詢直接可以鏈式代碼中完成
4、優化Query()鏈式查詢增加分頁,同時將Page()鏈式分頁代碼標註為作廢
5、優化一些注釋和日誌輸出
開源地址:
sqltoy特點說明:
* sqltoy的sql編寫(支持嵌套)
select *from sqltoy_device_order_info t where #[t.ORDER_ID=:orderId] #[and t.ORGAN_ID in (:authedOrganIds)] #[and t.STAFF_ID in (:staffIds)] #[and t.TRANS_DATE>=:beginDate] #[and t.TRANS_DATE<:endDate]
* mybatis同樣功能實現
select * from sqltoy_device_order_info t <where> <if test="orderId!=null"> and t.ORDER_ID=#{orderId} </if> <if test="authedOrganIds!=null"> and t.ORGAN_ID in <foreach collection="authedOrganIds" item="order_id" separator="," open="(" close=")"> #{order_id} </foreach> </if> <if test="staffIds!=null"> and t.STAFF_ID in <foreach collection="staffIds" item="staff_id" separator="," open="(" close=")"> #{staff_id} </foreach> </if> <if test="beginDate!=null"> and t.TRANS_DATE>=#{beginDate} </if> <if test="endDate!=null"> and t.TRANS_DATE<#{endDate} </if></where>
1、shortNanoTime 22位有序安全ID,格式: 13位當前毫秒+6位納秒+3位主機ID2、nanoTimeId 26位有序安全ID,格式:15位:yyMMddHHmmssSSS+6位納秒+2位(線程Id+隨機數)+3位主機ID3、uuid:32 位uuid4、SnowflakeId 雪花算法ID5、redisId 基於redis 來產生規則的ID主鍵
```java
public class SqlToyContext implements ApplicationContextAware {
// 省略其他代碼
/**
* @todo 提供可以動態增加解析sql片段配置的接口,並返回具體id,用於第三方平臺集成,如報表平臺等
* @param sqlSegment
* @return
* @throws Exception
*/
public synchronized SqlToyConfig parseSqlSegment(Object sqlSegment) throws Exception {
return scriptLoader.parseSqlSagment(sqlSegment);
}
}
```