Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1ed9a110
提交
1ed9a110
authored
10月 26, 2017
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
simplify the new Mode.ModeEnum stuff
上级
c99ad8ad
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
24 行删除
+20
-24
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
Mode.java
h2/src/main/org/h2/engine/Mode.java
+19
-23
没有找到文件。
h2/src/main/org/h2/engine/Database.java
浏览文件 @
1ed9a110
...
...
@@ -163,7 +163,7 @@ public class Database implements DataHandler {
private
boolean
referentialIntegrity
=
true
;
private
boolean
multiVersion
;
private
DatabaseCloser
closeOnExit
;
private
Mode
mode
=
Mode
.
get
Instance
(
Mode
.
REGULAR
);
private
Mode
mode
=
Mode
.
get
Regular
(
);
private
boolean
multiThreaded
;
private
int
maxOperationMemory
=
Constants
.
DEFAULT_MAX_OPERATION_MEMORY
;
...
...
h2/src/main/org/h2/engine/Mode.java
浏览文件 @
1ed9a110
...
...
@@ -17,16 +17,11 @@ import org.h2.util.StringUtils;
* PostgreSQL, MySQL). Each mode has different settings.
*/
public
class
Mode
{
public
enum
ModeEnum
{
REGULAR
,
DB2
,
Derby
,
MSSQLServer
,
HSQLDB
,
MySQL
,
Oracle
,
PostgreSQL
,
Ignite
,
REGULAR
,
DB2
,
Derby
,
MSSQLServer
,
HSQLDB
,
MySQL
,
Oracle
,
PostgreSQL
,
Ignite
}
/**
* The name of the default mode.
*/
static
final
String
REGULAR
=
ModeEnum
.
REGULAR
.
name
();
private
static
final
HashMap
<
String
,
Mode
>
MODES
=
New
.
hashMap
();
// Modes are also documented in the features section
...
...
@@ -182,16 +177,14 @@ public class Mode {
*/
public
Set
<
String
>
disallowedTypes
=
Collections
.
emptySet
();
private
final
String
name
;
private
ModeEnum
modeEnum
;
static
{
Mode
mode
=
new
Mode
(
ModeEnum
.
REGULAR
.
name
()
);
Mode
mode
=
new
Mode
(
ModeEnum
.
REGULAR
);
mode
.
nullConcatIsNull
=
true
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
DB2
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
DB2
);
mode
.
aliasColumnName
=
true
;
mode
.
supportOffsetFetch
=
true
;
mode
.
sysDummy1
=
true
;
...
...
@@ -206,7 +199,7 @@ public class Mode {
mode
.
allowDB2TimestampFormat
=
true
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
Derby
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
Derby
);
mode
.
aliasColumnName
=
true
;
mode
.
uniqueIndexSingleNull
=
true
;
mode
.
supportOffsetFetch
=
true
;
...
...
@@ -216,7 +209,7 @@ public class Mode {
mode
.
supportedClientInfoPropertiesRegEx
=
null
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
HSQLDB
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
HSQLDB
);
mode
.
aliasColumnName
=
true
;
mode
.
convertOnlyToSmallerScale
=
true
;
mode
.
nullConcatIsNull
=
true
;
...
...
@@ -229,7 +222,7 @@ public class Mode {
mode
.
supportedClientInfoPropertiesRegEx
=
null
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
MSSQLServer
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
MSSQLServer
);
mode
.
aliasColumnName
=
true
;
mode
.
squareBracketQuotedNames
=
true
;
mode
.
uniqueIndexSingleNull
=
true
;
...
...
@@ -241,7 +234,7 @@ public class Mode {
mode
.
supportedClientInfoPropertiesRegEx
=
null
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
MySQL
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
MySQL
);
mode
.
convertInsertNullToZero
=
true
;
mode
.
indexDefinitionInCreateTable
=
true
;
mode
.
lowerCaseIdentifiers
=
true
;
...
...
@@ -255,7 +248,7 @@ public class Mode {
mode
.
prohibitEmptyInPredicate
=
true
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
Oracle
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
Oracle
);
mode
.
aliasColumnName
=
true
;
mode
.
convertOnlyToSmallerScale
=
true
;
mode
.
uniqueIndexSingleNullExceptAllColumnsAreNull
=
true
;
...
...
@@ -268,7 +261,7 @@ public class Mode {
mode
.
prohibitEmptyInPredicate
=
true
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
PostgreSQL
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
PostgreSQL
);
mode
.
aliasColumnName
=
true
;
mode
.
nullConcatIsNull
=
true
;
mode
.
supportOffsetFetch
=
true
;
...
...
@@ -291,20 +284,19 @@ public class Mode {
mode
.
disallowedTypes
=
disallowedTypes
;
add
(
mode
);
mode
=
new
Mode
(
ModeEnum
.
Ignite
.
name
()
);
mode
=
new
Mode
(
ModeEnum
.
Ignite
);
mode
.
nullConcatIsNull
=
true
;
mode
.
allowAffinityKey
=
true
;
mode
.
indexDefinitionInCreateTable
=
true
;
add
(
mode
);
}
private
Mode
(
String
name
)
{
this
.
name
=
name
;
this
.
modeEnum
=
ModeEnum
.
valueOf
(
name
);
private
Mode
(
ModeEnum
modeEnum
)
{
this
.
modeEnum
=
modeEnum
;
}
private
static
void
add
(
Mode
mode
)
{
MODES
.
put
(
StringUtils
.
toUpperEnglish
(
mode
.
name
),
mode
);
MODES
.
put
(
StringUtils
.
toUpperEnglish
(
mode
.
modeEnum
.
name
()
),
mode
);
}
/**
...
...
@@ -317,6 +309,10 @@ public class Mode {
return
MODES
.
get
(
StringUtils
.
toUpperEnglish
(
name
));
}
public
static
Mode
getRegular
()
{
return
getInstance
(
ModeEnum
.
REGULAR
.
name
());
}
public
static
Mode
getMySQL
()
{
return
getInstance
(
ModeEnum
.
MySQL
.
name
());
}
...
...
@@ -326,7 +322,7 @@ public class Mode {
}
public
String
getName
()
{
return
name
;
return
modeEnum
.
name
()
;
}
public
ModeEnum
getEnum
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论