Skip to content

Commit f3c99c9

Browse files
committed
SQLConfig 和 SQLExecutor 也指定主键泛型
1 parent aa31231 commit f3c99c9

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/main/java/apijson/framework/APIJSONParser.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public FunctionParser getFunctionParser() {
125125
public Object onFunctionParse(String key, String function, String parentPath, String currentName, JSONObject currentObject, boolean containRaw) throws Exception {
126126
if (functionParser == null) {
127127
functionParser = createFunctionParser();
128+
functionParser.setParser(this);
128129
functionParser.setMethod(getMethod());
129130
functionParser.setTag(getTag());
130131
functionParser.setVersion(getVersion());
@@ -157,11 +158,11 @@ public APIJSONObjectParser createObjectParser(JSONObject request, String parentP
157158
// return super.newQueryConfig();
158159
// }
159160

160-
//导致最多评论的(Strong 30个)的那个动态详情界面Android(82001)无姓名和头像,即User=null
161+
// 导致最多评论的(Strong 30个)的那个动态详情界面Android(82001)无姓名和头像,即User=null
161162
// @Override
162163
// protected void onComplete() {
163164
// if (response != null) {
164-
// putQueryResult(path, response);//解决获取关联数据时requestObject里不存在需要的关联数据
165+
// putQueryResult(path, response); // 解决获取关联数据时requestObject里不存在需要的关联数据
165166
// }
166167
// }
167168

@@ -179,13 +180,6 @@ public void onVerifyContent() throws Exception {
179180
}
180181
super.onVerifyContent();
181182
}
182-
183-
184-
// //可重写来设置最大查询数量
185-
// @Override
186-
// public int getMaxQueryCount() {
187-
// return 50;
188-
// }
189183

190184

191185
}

src/main/java/apijson/framework/APIJSONSQLConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* TiDB 用法和 MySQL 一致
3737
* @author Lemon
3838
*/
39-
public class APIJSONSQLConfig extends AbstractSQLConfig {
39+
public class APIJSONSQLConfig<T extends Object> extends AbstractSQLConfig<T> {
4040
public static final String TAG = "APIJSONSQLConfig";
4141

4242
public static boolean ENABLE_COLUMN_CONFIG = false;
@@ -241,6 +241,7 @@ public AbstractSQLConfig setColumn(List<String> column) {
241241
}
242242
return super.setColumn(column);
243243
}
244+
244245
@Override
245246
public String getKey(String key) {
246247
if (ENABLE_COLUMN_CONFIG) {

src/main/java/apijson/framework/APIJSONSQLExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/**executor for query(read) or update(write) MySQL database
3636
* @author Lemon
3737
*/
38-
public class APIJSONSQLExecutor extends AbstractSQLExecutor {
38+
public class APIJSONSQLExecutor<T extends Object> extends AbstractSQLExecutor<T> {
3939
public static final String TAG = "APIJSONSQLExecutor";
4040

4141
static {

0 commit comments

Comments
 (0)