├── .bithoundrc
├── .coveralls.yml
├── .gitignore
├── .travis.yml
├── README.md
├── pom.xml
└── src
├── main
├── java
│ ├── README.md
│ └── my
│ │ └── sqlite
│ │ ├── annotation
│ │ ├── SqliteColumn.java
│ │ ├── SqliteID.java
│ │ ├── SqliteSql.java
│ │ ├── SqliteSqlWhereIf.java
│ │ ├── SqliteSqlWhereIfs.java
│ │ ├── SqliteTable.java
│ │ ├── SqliteTableSplit.java
│ │ └── SqliteTransient.java
│ │ ├── base
│ │ ├── SqliteBaseDao.java
│ │ ├── SqliteBaseEntity.java
│ │ └── SqliteBaseService.java
│ │ ├── config
│ │ └── SqliteConfig.java
│ │ ├── connection
│ │ ├── README.md
│ │ ├── SqliteBaseConnection.java
│ │ ├── SqliteBaseConnectionFactory.java
│ │ └── SqliteConnectionPool.java
│ │ ├── console
│ │ ├── SqliteConsoleBaseDao.java
│ │ ├── SqliteConsoleBaseEntity.java
│ │ └── SqliteConsoleBaseService.java
│ │ ├── constant
│ │ └── SqliteConstant.java
│ │ ├── exception
│ │ ├── SqliteConnectionException.java
│ │ └── SqliteConnectionMaxException.java
│ │ ├── thread
│ │ └── SqliteThreadUtils.java
│ │ └── utils
│ │ ├── SqliteConnectionUtils.java
│ │ ├── SqliteHelper.java
│ │ ├── SqliteJsonUtils.java
│ │ ├── SqliteLogUtils.java
│ │ ├── SqliteSqlHelper.java
│ │ └── SqliteUtils.java
└── resources
│ ├── README.md
│ ├── config
│ └── sqlite.properties
│ └── database
│ ├── readme.md
│ └── test.db
└── test
├── java
├── README.md
└── my
│ └── test
│ └── sqlite
│ ├── SqliteBatchTest.java
│ ├── SqliteCmdTest.java
│ ├── SqliteConnectionPoolTest.java
│ ├── SqliteSplitTest.java
│ ├── SqliteTableSplitTest.java
│ ├── SqliteTest.java
│ ├── dao
│ ├── TestSqliteSplitDao.java
│ ├── TestTableDao.java
│ └── TestTableSplitDao.java
│ ├── entity
│ ├── TestSqliteSplit.java
│ ├── TestTable.java
│ └── TestTableSplit.java
│ └── service
│ ├── TestSqliteSplitService.java
│ ├── TestTableService.java
│ └── TestTableSplitService.java
└── resources
├── README.md
└── database
└── test.db
/.bithoundrc:
--------------------------------------------------------------------------------
1 | {
2 | "ignore": [
3 | "**/deps/**",
4 | "**/node_modules/**",
5 | "**/thirdparty/**",
6 | "**/third_party/**",
7 | "**/vendor/**",
8 | "**/**-min-**",
9 | "**/**-min.**",
10 | "**/**.min.**",
11 | "**/**jquery.?(ui|effects)-*.*.?(*).?(cs|j)s",
12 | "**/**jquery-*.*.?(*).?(cs|j)s",
13 | "**/prototype?(*).js",
14 | "**/mootools*.*.*.js",
15 | "**/dojo.js",
16 | "**/MochiKit.js",
17 | "**/yahoo-*.js",
18 | "**/yui*.js",
19 | "**/ckeditor*.js",
20 | "**/tiny_mce*.js",
21 | "**/tiny_mce/?(langs|plugins|themes|utils)/**",
22 | "**/MathJax/**",
23 | "**/shBrush*.js",
24 | "**/shCore.js",
25 | "**/shLegacy.js",
26 | "**/modernizr.custom.?(*).js",
27 | "**/knockout-*.*.*.debug.js",
28 | "**/extjs/*.js",
29 | "**/extjs/*.xml",
30 | "**/extjs/*.txt",
31 | "**/extjs/*.html",
32 | "**/extjs/*.properties",
33 | "**/extjs/.sencha",
34 | "**/extjs/docs/**",
35 | "**/extjs/builds/**",
36 | "**/extjs/cmd/**",
37 | "**/extjs/examples/**",
38 | "**/extjs/locale/**",
39 | "**/extjs/packages/**",
40 | "**/extjs/plugins/**",
41 | "**/extjs/resources/**",
42 | "**/extjs/src/**",
43 | "**/extjs/welcome/**",
44 | "bower_components/**"
45 | ],
46 | "test": [
47 | "**/test/**",
48 | "**/tests/**",
49 | "**/spec/**",
50 | "**/specs/**"
51 | ]
52 | }
--------------------------------------------------------------------------------
/.coveralls.yml:
--------------------------------------------------------------------------------
1 | service_name: travis-ci
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files and Maven
2 | target/
3 |
4 | # Compiled class files
5 | *.class
6 |
7 | # Log Files
8 | *.log
9 |
10 | # About IntelliJ
11 | *.iml
12 | /.idea/
13 | /out/
14 |
15 | # BlueJ files
16 | *.ctxt
17 |
18 | # Mobile Tools for Java (J2ME)
19 | .mtj.tmp/
20 |
21 | # macOS
22 | .DS_Store
23 |
24 | # Package Files
25 | *.jar
26 | *.war
27 | *.ear
28 | *.zip
29 | *.tar.gz
30 | *.rar
31 |
32 | # CMake
33 | cmake-build-debug/
34 |
35 | # File-based project format
36 | *.iws
37 |
38 | # mpeltonen/sbt-idea plugin
39 | .idea_modules/
40 |
41 | # JIRA plugin
42 | atlassian-ide-plugin.xml
43 |
44 | # Crashlytics plugin (for Android Studio and IntelliJ)
45 | com_crashlytics_export_strings.xml
46 | crashlytics.properties
47 | crashlytics-build.properties
48 | fabric.properties
49 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - oraclejdk8
4 | after_success:
5 | - mvn clean cobertura:cobertura coveralls:cobertura
6 | notifications:
7 | slack: my-github:HR5snotT4kXfhchurTHqQOvc
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://travis-ci.org/petterobam/my-sqlite)
2 | [](https://opensource.org/licenses/mit-license.php)
3 | [](https://github.com/igrigorik/ga-beacon)
4 | [](http://github.com/badges/stability-badges)
5 |
6 | # my-sqlite
7 | sqlite 面向对象的数据库封装,自动创建、默认通用操作、自定义SQL和动态SQL,及无xml配置等。扩展实现sqlite表格分库,按日期自动生成库等。
8 |
9 | 新增控制台超类基础实现,应用实例:[https://github.com/petterobam/my-sqlite-console](https://github.com/petterobam/my-sqlite-console)
10 |
11 | # wiki目录
12 | 1. [使用示例](https://github.com/petterobam/my-sqlite/wiki/%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B)
13 | 2. [实现思路](https://github.com/petterobam/my-sqlite/wiki/%E5%AE%9E%E7%8E%B0%E6%80%9D%E8%B7%AF)
14 |
15 | # Todo清单
16 | 1. ~~自动建表~~
17 | 1. ~~增删查改等基本功能~~
18 | 1. ~~数量查询功能~~
19 | 1. ~~分表分库~~
20 | 1. ~~Sqlite控制台基础功能类~~
21 | 1. ~~自定义配置加载~~
22 | 1. **~~批量操作(事务)~~**
23 | 1. **缓存库基础功能类实现**
24 | 1. 缓存库和文件库混用实现
25 | 1. **~~连接池实现~~**
26 | 1. 查询分页功能实现
27 | 1. 备份工具实现
28 | 1. 密码连接实现
29 | 1. 密码库生成实现
30 |
31 | PS:更多完善的功能请参照
32 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | my-sqlite
8 | my-sqlite
9 | 1.0-SNAPSHOT
10 |
11 |
12 | 3.15.1
13 | 1.2.31
14 | 4.11
15 |
16 | 3.1
17 | UTF-8
18 | 2.19.1
19 |
20 |
21 |
22 |
23 |
24 | org.xerial
25 | sqlite-jdbc
26 | ${sqlite.version}
27 |
28 |
29 |
30 |
31 | com.alibaba
32 | fastjson
33 | ${fastjson.version}
34 |
35 |
36 |
37 |
38 | junit
39 | junit
40 | ${junit.version}
41 | test
42 |
43 |
44 |
45 |
46 |
47 | my-nexus-snapshots
48 | User Porject Snapshot
49 | http://localhost:8081/nexus/content/repositories/my-nexus-snapshots
50 | false
51 |
52 |
53 | my-nexus-releases
54 | User Porject Release
55 | http://localhost:8081/nexus/content/repositories/my-nexus-releases
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | src/main/java
64 |
65 | **/*.properties
66 | **/*.xml
67 |
68 |
69 |
70 |
71 | src/main/resources
72 |
73 |
74 | **/*.*
75 |
76 |
77 |
78 |
79 |
80 |
81 | org.apache.maven.plugins
82 | maven-surefire-plugin
83 | ${surefire-plugin.version}
84 |
85 | true
86 |
87 |
88 |
89 |
90 |
91 | maven-source-plugin
92 |
93 | true
94 |
95 |
96 |
97 | compile
98 |
99 | jar
100 |
101 |
102 |
103 |
104 |
105 |
106 | org.codehaus.mojo
107 | cobertura-maven-plugin
108 | 2.5.2
109 |
110 | xml
111 | 256m
112 | true
113 |
114 |
115 |
116 | org.eluder.coveralls
117 | coveralls-maven-plugin
118 | 2.2.0
119 |
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/src/main/java/README.md:
--------------------------------------------------------------------------------
1 | # Sqlite-OOP
2 |
3 | 源码负者人:[petterobam](https://github.com/petterobam)
4 |
5 | 相关博客:
6 |
7 | 1. [Sqlite数据库面向对象封装思路](http://www.db2oop.cn/blog/2018/03/25/sqlite-oop-idea)
8 | 2. [Sqlite-OOP子项目使用示例](http://www.db2oop.cn/blog/2018/03/25/sqlite-oop-use-cases)
9 |
10 | 问题建议:
11 |
12 | 1. [待办] - 将 ```@SqliteSql*({...})``` 这种动态Sql生成注解,用代码生成(编译时候)或动态规则转化存储(运行时候),优化动态解析效率 —— by [xiesiwen](https://github.com/xiesiwen)
13 | 2. [待办] - 动态分表功能简化实现 —— by [petterobam](https://github.com/petterobam)
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteColumn.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 | /**
4 | * Sqlite的表字段注解类
5 | *
6 | * @author 欧阳洁
7 | * @create 2017-09-30 11:20
8 | **/
9 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
10 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
11 | public @interface SqliteColumn {
12 | /**
13 | * 列名,默认空
14 | *
15 | * @return
16 | */
17 | String name() default "";
18 |
19 | /**
20 | * 主键默认类型,默认最大20位长度的字符串
21 | *
22 | * @return
23 | */
24 | String type() default "char(20)";
25 |
26 | /**
27 | * 是否不为空,默认否
28 | *
29 | * @return
30 | */
31 | boolean notNull() default false;
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteID.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 | /**
4 | * Sqlite的ID注解类
5 | *
6 | * @author 欧阳洁
7 | * @create 2017-09-30 11:20
8 | **/
9 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
10 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
11 | public @interface SqliteID {
12 | /**
13 | * 主键列名,默认空
14 | * @return
15 | */
16 | String name() default "";
17 | /**
18 | * 主键默认类型,默认integer类型
19 | * @return
20 | */
21 | String type() default "integer";
22 |
23 | /**
24 | * 主键是否自增长,默认是true
25 | * @return
26 | */
27 | boolean autoincrement() default true;
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteSql.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 | /**
4 | * 自定义SQL注解类
5 | *
6 | * @author 欧阳洁
7 | */
8 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.METHOD})
9 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
10 | public @interface SqliteSql {
11 | /**
12 | * 自定义的Sql语句,带占位符的Sql
13 | * @return
14 | */
15 | String sql();
16 | /**
17 | * 占位符顺序对应的参数顺序,默认不带参数
18 | * @return
19 | */
20 | String[] params() default "";
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteSqlWhereIf.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 | /**
4 | * 自定义注解辅助,条件判断注解,用于生成动态SQL
5 | *
6 | * @author 欧阳洁
7 | */
8 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.METHOD})
9 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
10 | @java.lang.annotation.Repeatable(SqliteSqlWhereIfs.class)
11 | public @interface SqliteSqlWhereIf {
12 | /**
13 | * 判断条件标识ID
14 | *
15 | * @return
16 | */
17 | int testId();
18 |
19 | /**
20 | * 所属层级,默认0,最外层
21 | *
22 | * @return
23 | */
24 | int parentTestId() default 0;
25 |
26 | /**
27 | * 判断条件类型,==、>、<、>=、<=、eq、ne
28 | *
29 | * @return
30 | */
31 | String testType() default "eq";
32 |
33 | /**
34 | * 判断字段名
35 | *
36 | * @return
37 | */
38 | String testName();
39 |
40 | /**
41 | * 符合条件的值
42 | *
43 | * @return
44 | */
45 | String[] testTrueValue();
46 |
47 | /**
48 | * 符合条件对应的动态SQL
49 | *
50 | * @return
51 | */
52 | String[] testTrueSql() default "";
53 |
54 | /**
55 | * 占位符顺序对应的参数顺序,默认不带参数
56 | *
57 | * @return
58 | */
59 | String[] params() default "";
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteSqlWhereIfs.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 | /**
4 | * 实现SqliteSqlWhereIf的重复注解
5 | * @author 欧阳洁
6 | */
7 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.METHOD})
8 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
9 | public @interface SqliteSqlWhereIfs {
10 | SqliteSqlWhereIf[] value();
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteTable.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 |
4 | /**
5 | * 表名注解类
6 | *
7 | * @author 欧阳洁
8 | * @create 2017-09-30 11:16
9 | **/
10 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE})
11 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
12 | public @interface SqliteTable {
13 | /**
14 | * 表名
15 | * @return
16 | */
17 | String name() default "";
18 | /**
19 | * 数据库文件路径
20 | * @return
21 | */
22 | String dbPath() default my.sqlite.constant.SqliteConstant.DB_PATH;
23 | /**
24 | * 数据库文件路径类型
25 | * @return
26 | */
27 | int dbType() default my.sqlite.constant.SqliteConstant.DB_TYPE_DEFAULT;
28 | }
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteTableSplit.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 | /**
4 | * 分表属性注解
5 | * @author 欧阳洁
6 | */
7 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
8 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
9 | public @interface SqliteTableSplit {
10 | /**
11 | * 后缀链接字符
12 | * @return
13 | */
14 | String joinStr() default "_";
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/annotation/SqliteTransient.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.annotation;
2 |
3 | /**
4 | * 非表字段标识注解
5 | *
6 | * @author 欧阳洁
7 | */
8 | @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
9 | @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
10 | public @interface SqliteTransient {
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/my/sqlite/base/SqliteBaseDao.java:
--------------------------------------------------------------------------------
1 | package my.sqlite.base;
2 |
3 | import my.sqlite.constant.SqliteConstant;
4 | import my.sqlite.utils.SqliteHelper;
5 | import my.sqlite.utils.SqliteSqlHelper;
6 | import my.sqlite.utils.SqliteUtils;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 | import java.util.Map;
11 | import java.util.Vector;
12 |
13 | /**
14 | * Sqlite基础dao
15 | *
16 | * @author 欧阳洁
17 | * @create 2017-09-30 10:28
18 | **/
19 | public abstract class SqliteBaseDao {
20 | private String tableName;
21 | private Class entityClazz;
22 | private SqliteSqlHelper sqlHelper;
23 | private SqliteHelper sqliteHelper;
24 |
25 | public SqliteBaseDao(Class entityClass) {
26 | this.entityClazz = entityClass;
27 | this.sqlHelper = new SqliteSqlHelper(entityClass);
28 | this.tableName = this.sqlHelper.getTableName();
29 | this.sqliteHelper = new SqliteHelper(entityClass);
30 | //调用该方法就能在使用时检查和创建表,可以通过配置信息判断是否执调用,达到开关控制的效果
31 | this.existOrCreateTable();
32 | }
33 |
34 | /**
35 | * 检查表是否存在,不存在则创建
36 | */
37 | public void existOrCreateTable() {
38 | String sql = this.sqlHelper.createTableSql();
39 | this.sqliteHelper.execute(sql);
40 | }
41 |
42 | /**
43 | * 插入
44 | *
45 | * @param sql
46 | * @return
47 | */
48 | public int insert(String sql) {
49 | return this.sqliteHelper.insert(sql);
50 | }
51 |
52 | /**
53 | * 插入
54 | *
55 | * @param entity
56 | * @return
57 | */
58 | public int insert(T entity) {
59 | this.sqlHelper.createInsert(entity);
60 | if (!SqliteUtils.isBlank(entity.getNeedCreateBefSql())) {
61 | //插入数据之前判断是否需要建表
62 | this.sqliteHelper.execute(entity.getNeedCreateBefSql());
63 | }
64 | return this.sqliteHelper.insert(entity.getCurrentSql(), entity.getCurrentParam());
65 | }
66 |
67 | /**
68 | * 批量插入
69 | *
70 | * @param sqlList
71 | * @return
72 | */
73 | public int batchInsertSql(List sqlList) {
74 | return this.sqliteHelper.batchInsertSql(sqlList);
75 | }
76 |
77 | /**
78 | * 批量插入
79 | *
80 | * @param sqlList
81 | * @param batchCount
82 | * @return
83 | */
84 | public int batchInsertSql(List sqlList, int batchCount) {
85 | return this.sqliteHelper.batchInsertSql(sqlList, batchCount);
86 | }
87 |
88 | /**
89 | * 批量插入
90 | *
91 | * @param list
92 | * @return
93 | */
94 | public int batchInsert(List list) {
95 | return this.batchInsert(list, SqliteConstant.DEFAULT_BATCH_COUNT);
96 | }
97 |
98 | /**
99 | * 批量插入
100 | *
101 | * @param list
102 | * @param batchCount
103 | * @return
104 | */
105 | public int batchInsert(List list, int batchCount) {
106 | if (SqliteUtils.isNotEmpty(list)) {
107 | for (T entity : list) {
108 | this.sqlHelper.createInsert(entity);
109 | }
110 | } else {
111 | return 0;
112 | }
113 | return this.sqliteHelper.batchInsert(list, batchCount);
114 | }
115 |
116 | /**
117 | * 修改
118 | *
119 | * @param sql
120 | * @return
121 | */
122 | public int update(String sql) {
123 | return this.sqliteHelper.update(sql);
124 | }
125 |
126 | /**
127 | * 修改
128 | *
129 | * @param entity
130 | * @return
131 | */
132 | public int update(T entity) {
133 | this.sqlHelper.createUpdate(entity);
134 | return this.sqliteHelper.update(entity.getCurrentSql(), entity.getCurrentParam());
135 | }
136 |
137 | /**
138 | * 批量修改
139 | *
140 | * @param sqlList
141 | * @return
142 | */
143 | public int batchUpdateSql(List sqlList) {
144 | return this.sqliteHelper.batchUpdateSql(sqlList);
145 | }
146 |
147 | /**
148 | * 批量修改
149 | *
150 | * @param sqlList
151 | * @param batchCount
152 | * @return
153 | */
154 | public int batchUpdateSql(List sqlList, int batchCount) {
155 | return this.sqliteHelper.batchUpdateSql(sqlList, batchCount);
156 | }
157 |
158 | /**
159 | * 批量修改
160 | *
161 | * @param list
162 | * @return
163 | */
164 | public int batchUpdate(List list) {
165 | return this.batchUpdate(list, SqliteConstant.DEFAULT_BATCH_COUNT);
166 | }
167 |
168 | /**
169 | * 批量修改
170 | *
171 | * @param list
172 | * @param batchCount
173 | * @return
174 | */
175 | public int batchUpdate(List list, int batchCount) {
176 | if (SqliteUtils.isNotEmpty(list)) {
177 | for (T entity : list) {
178 | this.sqlHelper.createUpdate(entity);
179 | }
180 | } else {
181 | return 0;
182 | }
183 | return this.sqliteHelper.batchUpdate(list, batchCount);
184 | }
185 |
186 | /**
187 | * 删除
188 | *
189 | * @param sql
190 | * @return
191 | */
192 | public int delete(String sql) {
193 | return this.sqliteHelper.delete(sql);
194 | }
195 |
196 | /**
197 | * 删除
198 | *
199 | * @param entity
200 | * @return
201 | */
202 | public int delete(T entity) {
203 | this.sqlHelper.createDelete(entity);
204 | return this.sqliteHelper.delete(entity.getCurrentSql(), entity.getCurrentParam());
205 | }
206 |
207 | /**
208 | * 批量删除
209 | *
210 | * @param sqlList
211 | * @return
212 | */
213 | public int batchDeleteSql(List sqlList) {
214 | return this.sqliteHelper.batchDeleteSql(sqlList);
215 | }
216 |
217 | /**
218 | * 批量删除
219 | *
220 | * @param sqlList
221 | * @param batchCount
222 | * @return
223 | */
224 | public int batchDeleteSql(List sqlList, int batchCount) {
225 | return this.sqliteHelper.batchDeleteSql(sqlList, batchCount);
226 | }
227 |
228 | /**
229 | * 批量删除
230 | *
231 | * @param list
232 | * @return
233 | */
234 | public int batchDelete(List list) {
235 | return this.batchDelete(list, SqliteConstant.DEFAULT_BATCH_COUNT);
236 | }
237 |
238 | /**
239 | * 批量删除
240 | *
241 | * @param list
242 | * @param batchCount
243 | * @return
244 | */
245 | public int batchDelete(List list, int batchCount) {
246 | if (SqliteUtils.isNotEmpty(list)) {
247 | for (T entity : list) {
248 | this.sqlHelper.createDelete(entity);
249 | }
250 | } else {
251 | return 0;
252 | }
253 | return this.sqliteHelper.batchDelete(list, batchCount);
254 | }
255 |
256 | /**
257 | * 通过ID集合,批量删除
258 | *
259 | * @param list
260 | * @return
261 | */
262 | public int batchDeleteByIdList(List