ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
### ClickHouseStyle例子 ```java public class ClickHouseStyle extends AbstractDBStyle { RangeSql rangeSql = null; public ClickHouseStyle() { super(); rangeSql = new OffsetLimitRange(this); } @Override public int getIdType(Class c,String idProperty) { //只支持 return DBType.ID_ASSIGN; } @Override public boolean isNoSql(){ return true; } @Override public String getName() { return "clickhouse"; } @Override public int getDBType() { return DBType.DB_CLICKHOUSE; } @Override public RangeSql getRangeSql() { return rangeSql; } @Override protected void checkId(Collection colsId, Collection attrsId, String clsName) { // 不检测主键 return ; } @Override public void config(SQLManager sqlManager){ Map<Class, JavaSqlTypeHandler> handlerMap = sqlManager.getDefaultBeanProcessors().getHandlers(); handlerMap.put(java.util.Date.class,new UtilDateTypeHandler() ); } } ``` 由于Clickhouse的翻页风格类似MySQL,因此rangeSql重用了OffsetLimitRange类 * getIdType,由于clickhouse不支持序列和自增主键,因此,这里直接使用DBType.ID_ASSIGN * isNoSql 返回true * checkId方法,不检查主键,因为clickhouse实际上并没有唯一主键的概念