Skip to content

Commit 0dabd7b

Browse files
committed
SQLConfig 和 SQLExecutor 也指定主键泛型
1 parent cebdddf commit 0dabd7b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static void main(String[] args) throws Exception {
9393
// 上线生产环境前改为 false,可不输出 APIJSONORM 的日志 以及 SQLException 的原始(敏感)信息
9494
unitauto.Log.DEBUG = Log.DEBUG = true;
9595
APIJSONParser.IS_PRINT_BIG_LOG = true;
96-
// APIJSONSQLConfig.ENABLE_COLUMN_CONFIG = true; // apijson-framework 已集成字段插件 apijson-column,支持 !key 反选字段 和 字段名映射
96+
// APIJSONSQLConfig.ENABLE_COLUMN_CONFIG = true; // apijson-framework 已集成字段插件 apijson-column,支持 !key 反选字段 和 字段名映射
9797
APIJSONApplication.init();
9898
APIJSONRouterApplication.init();
9999
System.out.println("\n\n<<<<<<<<< 本 Demo 在 resources/static 内置了 APIAuto,Chrome/Firefox 打开 http://localhost:8080 即可调试(端口号根据项目配置而定) ^_^ >>>>>>>>>\n");

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ public APIJSONParser<Long> setSession(HttpSession session) {
106106
Boolean asDBAccount = (Boolean) session.getAttribute(DemoController.AS_DB_ACCOUNT);
107107
this.asDBAccount = asDBAccount != null && asDBAccount;
108108
if (this.asDBAccount) {
109-
//User user = (User) session.getAttribute(DemoController.USER_);
110-
//this.dbAccount = user.getName();
109+
// User user = (User) session.getAttribute(DemoController.USER_);
110+
// this.dbAccount = user.getName();
111111
Privacy privacy = (Privacy) session.getAttribute(DemoController.PRIVACY_);
112112
this.dbAccount = privacy.getPhone();
113113
this.dbPassword = privacy.get__password();

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLConfig.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* https://github.com/Tencent/APIJSON/blob/master/%E8%AF%A6%E7%BB%86%E7%9A%84%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3.md#c-1-1%E4%BF%AE%E6%94%B9%E6%95%B0%E6%8D%AE%E5%BA%93%E9%93%BE%E6%8E%A5
4242
* @author Lemon
4343
*/
44-
public class DemoSQLConfig extends APIJSONSQLConfig {
44+
public class DemoSQLConfig extends APIJSONSQLConfig<Long> {
4545

4646
public DemoSQLConfig() {
4747
super();
@@ -355,16 +355,16 @@ public void setSql(String sql) {
355355

356356

357357
@Override
358-
protected void onGetCrossJoinString(Join j) throws UnsupportedOperationException {
359-
// 开启 CROSS JOIN 笛卡尔积联表 super.onGetCrossJoinString(j);
358+
protected void onGetCrossJoinString(Join join) throws UnsupportedOperationException {
359+
// 开启 CROSS JOIN 笛卡尔积联表 super.onGetCrossJoinString(join);
360360
}
361361
@Override
362-
protected void onJoinNotRelation(String sql, String quote, Join j, String jt, List<On> onList, On on) {
363-
// 开启 JOIN ON t1.c1 != t2.c2 等不等式关联 super.onJoinNotRelation(sql, quote, j, jt, onList, on);
362+
protected void onJoinNotRelation(String sql, String quote, Join join, String table, List<On> onList, On on) {
363+
// 开启 JOIN ON t1.c1 != t2.c2 等不等式关联 super.onJoinNotRelation(sql, quote, join, table, onList, on);
364364
}
365365
@Override
366366
protected void onJoinComplexRelation(String sql, String quote, Join join, String table, List<On> onList, On on) {
367-
// 开启 JOIN ON t1.c1 LIKE concat('%', t2.c2, '%') 等复杂关联 super.onJoinComplextRelation(sql, quote, join, table, onList, on);
367+
// 开启 JOIN ON t1.c1 LIKE concat('%', t2.c2, '%') 等复杂关联 super.onJoinComplexRelation(sql, quote, join, table, onList, on);
368368
}
369369

370370

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
*
6363
* @author Lemon
6464
*/
65-
public class DemoSQLExecutor extends APIJSONSQLExecutor {
65+
public class DemoSQLExecutor extends APIJSONSQLExecutor<Long> {
6666
public static final String TAG = "DemoSQLExecutor";
6767

6868
// Redis 缓存 <<<<<<<<<<<<<<<<<<<<<<<

0 commit comments

Comments
 (0)