Skip to content

Commit

Permalink
新增支持 NoSQL 数据库 MongoDB,版本升到 6.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLemon committed Jan 3, 2024
1 parent f1bbdf1 commit f3dc785
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion APIJSONORM/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.Tencent</groupId>
<artifactId>APIJSON</artifactId>
<version>6.3.0</version>
<version>6.4.0</version>
<packaging>jar</packaging>

<name>APIJSONORM</name>
Expand Down
2 changes: 1 addition & 1 deletion APIJSONORM/src/main/java/apijson/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Log {

public static boolean DEBUG = true;

public static final String VERSION = "6.3.0";
public static final String VERSION = "6.4.0";
public static final String KEY_SYSTEM_INFO_DIVIDER = "\n---|-----APIJSON SYSTEM INFO-----|---\n";

public static final String OS_NAME;
Expand Down
20 changes: 19 additions & 1 deletion APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public abstract class AbstractSQLConfig<T extends Object> implements SQLConfig<T
DATABASE_LIST.add(DATABASE_INFLUXDB);
DATABASE_LIST.add(DATABASE_TDENGINE);
DATABASE_LIST.add(DATABASE_REDIS);
DATABASE_LIST.add(DATABASE_MONGODB);
DATABASE_LIST.add(DATABASE_KAFKA);
DATABASE_LIST.add(DATABASE_MQ);

RAW_MAP = new LinkedHashMap<>(); // 保证顺序,避免配置冲突等意外情况
Expand Down Expand Up @@ -1245,12 +1247,28 @@ public static boolean isRedis(String db) {
return DATABASE_REDIS.equals(db);
}

@Override
public boolean isMongoDB() {
return isMongoDB(getSQLDatabase());
}
public static boolean isMongoDB(String db) {
return DATABASE_MONGODB.equals(db);
}

@Override
public boolean isKafka() {
return isKafka(getSQLDatabase());
}
public static boolean isKafka(String db) {
return DATABASE_KAFKA.equals(db);
}

@Override
public boolean isMQ() {
return isMQ(getSQLDatabase());
}
public static boolean isMQ(String db) {
return DATABASE_MQ.equals(db);
return isKafka(db);
}

@Override
Expand Down
10 changes: 7 additions & 3 deletions APIJSONORM/src/main/java/apijson/orm/SQLConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public interface SQLConfig<T extends Object> {
String DATABASE_CASSANDRA = "CASSANDRA"; // https://cassandra.apache.org
String DATABASE_INFLUXDB = "INFLUXDB"; // https://www.influxdata.com/products/influxdb-overview
String DATABASE_TDENGINE = "TDENGINE"; // https://tdengine.com
String DATABASE_REDIS = "REDIS";
String DATABASE_MQ = "MQ";
String DATABASE_REDIS = "REDIS"; // https://redisql.com
String DATABASE_MONGODB = "MONGODB"; // https://www.mongodb.com/docs/atlas/data-federation/query/query-with-sql
String DATABASE_KAFKA = "KAFKA"; // https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server/APIJSONDemo-MultiDataSource-Kafka
String DATABASE_MQ = "MQ"; //

String SCHEMA_INFORMATION = "information_schema"; //MySQL, PostgreSQL, SQL Server 都有的系统模式
String SCHEMA_SYS = "sys"; //SQL Server 系统模式
Expand Down Expand Up @@ -84,10 +86,12 @@ public interface SQLConfig<T extends Object> {
boolean isInfluxDB();
boolean isTDengine();
boolean isRedis();
boolean isMongoDB();
boolean isKafka();
boolean isMQ();


//暂时只兼容以上几种
// 暂时只兼容以上几种
// boolean isSQL();
// boolean isTSQL();
// boolean isPLSQL();
Expand Down

0 comments on commit f3dc785

Please sign in to comment.