@@ -51,32 +51,38 @@ public class APIJSONSQLConfig<T, M extends Map<String, Object>, L extends List<O
5151
5252 @ Override
5353 public SQLConfig <Long , LinkedHashMap <String , Object >, List <Object >> getSQLConfig (
54- RequestMethod method , String database , String schema , String datasource , String table ) {
54+ RequestMethod method , String database , String datasource , String namespace , String catalog
55+ , String schema , String table ) {
5556 SQLConfig <Long , LinkedHashMap <String , Object >, List <Object >> config = APIJSONApplication .createSQLConfig ();
5657 config .setMethod (method );
5758 config .setDatabase (database );
5859 config .setDatasource (datasource );
60+ config .setNamespace (namespace );
61+ config .setCatalog (catalog );
5962 config .setSchema (schema );
6063 config .setTable (table );
6164 return config ;
6265 }
6366
6467 //取消注释来实现自定义各个表的主键名
6568 // @Override
66- // public String getIdKey(String database, String schema, String datasource, String table) {
69+ // public String getIdKey(String database, String datasource, String namespace
70+ // , String catalog, String schema, String table) {
6771 // return StringUtil.firstCase(table + "Id"); // userId, comemntId ...
6872 // // return StringUtil.toLowerCase(t) + "_id"; // user_id, comemnt_id ...
6973 // // return StringUtil.toUpperCase(t) + "_ID"; // USER_ID, COMMENT_ID ...
7074 // }
7175
7276 @ Override
73- public String getUserIdKey (String database , String schema , String datasource , String table ) {
77+ public String getUserIdKey (String database , String datasource , String namespace , String catalog
78+ , String schema , String table ) {
7479 return USER_ .equals (table ) || PRIVACY_ .equals (table ) ? ID : USER_ID ; // id / userId
7580 }
7681
7782 //取消注释来实现数据库自增 id
7883 // @Override
79- // public Object newId(RequestMethod method, String database, String schema, String datasource, String table) {
84+ // public Object newId(RequestMethod method, String database, String datasource, String namespace
85+ // , String catalog, String schema, String table) {
8086 // return null; // return null 则不生成 id,一般用于数据库自增 id
8187 // }
8288 };
@@ -392,12 +398,12 @@ public String gainSQLSchema() {
392398
393399 @ Override
394400 public String getIdKey () {
395- return SIMPLE_CALLBACK .getIdKey (getDatabase (), getSchema (), getDatasource (), getTable ());
401+ return SIMPLE_CALLBACK .getIdKey (getDatabase (), getDatasource (), getNamespace (), getCatalog (), getSchema (), getTable ());
396402 }
397403
398404 @ Override
399405 public String getUserIdKey () {
400- return SIMPLE_CALLBACK .getUserIdKey (getDatabase (), getSchema (), getDatasource (), getTable ());
406+ return SIMPLE_CALLBACK .getUserIdKey (getDatabase (), getDatasource (), getNamespace (), getCatalog (), getSchema (), getTable ());
401407 }
402408
403409
0 commit comments