mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-12 03:03:08 +08:00
feat(data/core): 新增获取数据库类型带默认类型方法
This commit is contained in:
@@ -44,6 +44,19 @@ public class MetaUtils {
|
|||||||
private MetaUtils() {
|
private MetaUtils() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据库类型(如果获取不到数据库类型,则返回默认数据库类型)
|
||||||
|
*
|
||||||
|
* @param dataSource 数据源
|
||||||
|
* @param defaultValue 默认数据库类型
|
||||||
|
* @return 数据库类型
|
||||||
|
* @since 1.4.1
|
||||||
|
*/
|
||||||
|
public static DatabaseType getDatabaseTypeOrDefault(DataSource dataSource, DatabaseType defaultValue) {
|
||||||
|
DatabaseType databaseType = getDatabaseType(dataSource);
|
||||||
|
return null == databaseType ? defaultValue : databaseType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取数据库类型
|
* 获取数据库类型
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user