Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
6e8730ae
提交
6e8730ae
authored
8月 02, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
boolean getX > isX
上级
d57c80c0
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
28 行增加
和
28 行删除
+28
-28
Column.java
h2/src/main/org/h2/table/Column.java
+3
-3
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+16
-16
Table.java
h2/src/main/org/h2/table/Table.java
+4
-4
TableFilter.java
h2/src/main/org/h2/table/TableFilter.java
+1
-1
TableLink.java
h2/src/main/org/h2/table/TableLink.java
+2
-2
TableView.java
h2/src/main/org/h2/table/TableView.java
+2
-2
没有找到文件。
h2/src/main/org/h2/table/Column.java
浏览文件 @
6e8730ae
...
...
@@ -433,7 +433,7 @@ public class Column {
return
buff
.
toString
();
}
public
boolean
get
Nullable
()
{
public
boolean
is
Nullable
()
{
return
nullable
;
}
...
...
@@ -449,7 +449,7 @@ public class Column {
return
defaultExpression
;
}
public
boolean
get
AutoIncrement
()
{
public
boolean
is
AutoIncrement
()
{
return
autoIncrement
;
}
...
...
@@ -625,7 +625,7 @@ public class Column {
return
true
;
}
public
boolean
get
PrimaryKey
()
{
public
boolean
is
PrimaryKey
()
{
return
primaryKey
;
}
...
...
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
6e8730ae
...
...
@@ -623,8 +623,8 @@ public class MetaTable extends Table {
continue
;
}
String
storageType
;
if
(
table
.
get
Temporary
())
{
if
(
table
.
get
GlobalTemporary
())
{
if
(
table
.
is
Temporary
())
{
if
(
table
.
is
GlobalTemporary
())
{
storageType
=
"GLOBAL TEMPORARY"
;
}
else
{
storageType
=
"LOCAL TEMPORARY"
;
...
...
@@ -680,7 +680,7 @@ public class MetaTable extends Table {
// COLUMN_DEFAULT
c
.
getDefaultSQL
(),
// IS_NULLABLE
c
.
get
Nullable
()
?
"YES"
:
"NO"
,
c
.
is
Nullable
()
?
"YES"
:
"NO"
,
// DATA_TYPE
""
+
DataType
.
convertTypeToSQLType
(
c
.
getType
()),
// CHARACTER_MAXIMUM_LENGTH
...
...
@@ -700,7 +700,7 @@ public class MetaTable extends Table {
// TYPE_NAME
identifier
(
DataType
.
getDataType
(
c
.
getType
()).
name
),
// NULLABLE
""
+
(
c
.
get
Nullable
()
?
DatabaseMetaData
.
columnNullable
:
DatabaseMetaData
.
columnNoNulls
)
,
""
+
(
c
.
is
Nullable
()
?
DatabaseMetaData
.
columnNullable
:
DatabaseMetaData
.
columnNoNulls
)
,
// IS_COMPUTED
""
+
(
c
.
getComputed
()
?
"TRUE"
:
"FALSE"
),
// SELECTIVITY
...
...
@@ -748,7 +748,7 @@ public class MetaTable extends Table {
// TABLE_NAME
tableName
,
// NON_UNIQUE
index
.
getIndexType
().
get
Unique
()
?
"FALSE"
:
"TRUE"
,
index
.
getIndexType
().
is
Unique
()
?
"FALSE"
:
"TRUE"
,
// INDEX_NAME
identifier
(
index
.
getName
()),
// ORDINAL_POSITION
...
...
@@ -758,7 +758,7 @@ public class MetaTable extends Table {
// CARDINALITY
"0"
,
// PRIMARY_KEY
index
.
getIndexType
().
get
PrimaryKey
()
?
"TRUE"
:
"FALSE"
,
index
.
getIndexType
().
is
PrimaryKey
()
?
"TRUE"
:
"FALSE"
,
// INDEX_TYPE_NAME
index
.
getIndexType
().
getSQL
(),
// IS_GENERATED
...
...
@@ -813,7 +813,7 @@ public class MetaTable extends Table {
add
(
rows
,
new
String
[]{
"info.VERSION_MAJOR"
,
""
+
Constants
.
VERSION_MAJOR
});
add
(
rows
,
new
String
[]{
"info.VERSION_MINOR"
,
""
+
Constants
.
VERSION_MINOR
});
add
(
rows
,
new
String
[]{
"info.VERSION"
,
""
+
Constants
.
getFullVersion
()});
if
(
session
.
getUser
().
get
Admin
())
{
if
(
session
.
getUser
().
is
Admin
())
{
String
[]
settings
=
new
String
[]{
"java.runtime.version"
,
"java.vm.name"
,
"java.vendor"
,
...
...
@@ -864,7 +864,7 @@ public class MetaTable extends Table {
DiskFile
dataFile
=
database
.
getDataFile
();
if
(
dataFile
!=
null
)
{
add
(
rows
,
new
String
[]
{
"CACHE_TYPE"
,
dataFile
.
getCache
().
getTypeName
()
});
if
(
session
.
getUser
().
get
Admin
())
{
if
(
session
.
getUser
().
is
Admin
())
{
DiskFile
indexFile
=
database
.
getIndexFile
();
add
(
rows
,
new
String
[]{
"info.FILE_DISK_WRITE"
,
""
+
dataFile
.
getWriteCount
()});
add
(
rows
,
new
String
[]{
"info.FILE_DISK_READ"
,
""
+
dataFile
.
getReadCount
()});
...
...
@@ -973,7 +973,7 @@ public class MetaTable extends Table {
// NAME
identifier
(
u
.
getName
()),
// ADMIN
String
.
valueOf
(
u
.
get
Admin
()),
String
.
valueOf
(
u
.
is
Admin
()),
// REMARKS
replaceNullWithEmpty
(
u
.
getComment
()),
// ID
...
...
@@ -1239,7 +1239,7 @@ public class MetaTable extends Table {
// IS_UPDATABLE
"NO"
,
// STATUS
view
.
get
Invalid
()
?
"INVALID"
:
"VALID"
,
view
.
is
Invalid
()
?
"INVALID"
:
"VALID"
,
// REMARKS
replaceNullWithEmpty
(
view
.
getComment
()),
// ID
...
...
@@ -1412,7 +1412,7 @@ public class MetaTable extends Table {
// COLUMN_DEFAULT
col
.
getDefaultSQL
(),
// IS_NULLABLE
col
.
get
Nullable
()
?
"YES"
:
"NO"
,
col
.
is
Nullable
()
?
"YES"
:
"NO"
,
// DATA_TYPE
""
+
col
.
getDataType
().
sqlType
,
// PRECISION INT
...
...
@@ -1455,13 +1455,13 @@ public class MetaTable extends Table {
// TABLE_NAME
identifier
(
table
.
getName
()),
// BEFORE BIT
""
+
trigger
.
get
Before
(),
""
+
trigger
.
is
Before
(),
// JAVA_CLASS
trigger
.
getTriggerClassName
(),
// QUEUE_SIZE INT
""
+
trigger
.
getQueueSize
(),
// NO_WAIT BIT
""
+
trigger
.
get
NoWait
(),
""
+
trigger
.
is
NoWait
(),
// REMARKS
replaceNullWithEmpty
(
trigger
.
getComment
()),
// SQL
...
...
@@ -1473,7 +1473,7 @@ public class MetaTable extends Table {
break
;
}
case
SESSIONS:
{
boolean
admin
=
session
.
getUser
().
get
Admin
();
boolean
admin
=
session
.
getUser
().
is
Admin
();
for
(
Session
s
:
database
.
getSessions
(
false
))
{
if
(
admin
||
s
==
session
)
{
Command
command
=
s
.
getCurrentCommand
();
...
...
@@ -1494,7 +1494,7 @@ public class MetaTable extends Table {
break
;
}
case
LOCKS:
{
boolean
admin
=
session
.
getUser
().
get
Admin
();
boolean
admin
=
session
.
getUser
().
is
Admin
();
for
(
Session
s
:
database
.
getSessions
(
false
))
{
if
(
admin
||
s
==
session
)
{
for
(
Table
table
:
s
.
getLocks
())
{
...
...
@@ -1618,7 +1618,7 @@ public class MetaTable extends Table {
String
isGrantable
=
"NO"
;
if
(
grantee
.
getType
()
==
DbObject
.
USER
)
{
User
user
=
(
User
)
grantee
;
if
(
user
.
get
Admin
())
{
if
(
user
.
is
Admin
())
{
// the right is grantable if the grantee is an admin
isGrantable
=
"YES"
;
}
...
...
h2/src/main/org/h2/table/Table.java
浏览文件 @
6e8730ae
...
...
@@ -417,7 +417,7 @@ public abstract class Table extends SchemaObjectBase {
while
(
sequences
!=
null
&&
sequences
.
size
()
>
0
)
{
Sequence
sequence
=
sequences
.
get
(
0
);
sequences
.
remove
(
0
);
if
(!
get
Temporary
())
{
if
(!
is
Temporary
())
{
// only remove if no other table depends on this sequence
// this is possible when calling ALTER TABLE ALTER COLUMN
if
(
database
.
getDependentTable
(
sequence
,
this
)
==
null
)
{
...
...
@@ -550,7 +550,7 @@ public abstract class Table extends SchemaObjectBase {
ObjectArray
<
Index
>
indexes
=
getIndexes
();
for
(
int
i
=
0
;
indexes
!=
null
&&
i
<
indexes
.
size
();
i
++)
{
Index
idx
=
indexes
.
get
(
i
);
if
(
idx
.
getIndexType
().
get
PrimaryKey
())
{
if
(
idx
.
getIndexType
().
is
PrimaryKey
())
{
return
idx
;
}
}
...
...
@@ -608,7 +608,7 @@ public abstract class Table extends SchemaObjectBase {
ObjectArray
<
Index
>
indexes
=
getIndexes
();
if
(
indexes
!=
null
)
{
remove
(
indexes
,
index
);
if
(
index
.
getIndexType
().
get
PrimaryKey
())
{
if
(
index
.
getIndexType
().
is
PrimaryKey
())
{
for
(
Column
col
:
index
.
getColumns
())
{
col
.
setPrimaryKey
(
false
);
}
...
...
@@ -784,7 +784,7 @@ public abstract class Table extends SchemaObjectBase {
}
}
public
boolean
get
GlobalTemporary
()
{
public
boolean
is
GlobalTemporary
()
{
return
false
;
}
...
...
h2/src/main/org/h2/table/TableFilter.java
浏览文件 @
6e8730ae
...
...
@@ -583,7 +583,7 @@ public class TableFilter implements ColumnResolver {
this
.
used
=
used
;
}
public
boolean
get
Used
()
{
public
boolean
is
Used
()
{
return
used
;
}
...
...
h2/src/main/org/h2/table/TableLink.java
浏览文件 @
6e8730ae
...
...
@@ -297,7 +297,7 @@ public class TableLink extends Table {
public
String
getCreateSQL
()
{
StringBuilder
buff
=
new
StringBuilder
(
"CREATE FORCE "
);
if
(
get
Temporary
())
{
if
(
is
Temporary
())
{
if
(
globalTemporary
)
{
buff
.
append
(
"GLOBAL "
);
}
...
...
@@ -480,7 +480,7 @@ public class TableLink extends Table {
public
Index
getUniqueIndex
()
{
for
(
Index
idx
:
indexes
)
{
if
(
idx
.
getIndexType
().
get
Unique
())
{
if
(
idx
.
getIndexType
().
is
Unique
())
{
return
idx
;
}
}
...
...
h2/src/main/org/h2/table/TableView.java
浏览文件 @
6e8730ae
...
...
@@ -133,7 +133,7 @@ public class TableView extends Table {
*
* @return true if it is
*/
public
boolean
get
Invalid
()
{
public
boolean
is
Invalid
()
{
return
createException
!=
null
;
}
...
...
@@ -246,7 +246,7 @@ public class TableView extends Table {
}
public
String
getSQL
()
{
if
(
get
Temporary
())
{
if
(
is
Temporary
())
{
return
"("
+
querySQL
+
")"
;
}
return
super
.
getSQL
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论