Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
0ea30d28
提交
0ea30d28
authored
1月 26, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
6f67c668
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
441 行增加
和
100 行删除
+441
-100
H2Dictionary.java.txt
...c/tools/org/apache/openjpa/jdbc/sql/H2Dictionary.java.txt
+10
-10
CodeSwitch.java
h2/src/tools/org/h2/tools/code/CodeSwitch.java
+17
-17
PropertiesToUTF8.java
h2/src/tools/org/h2/tools/code/PropertiesToUTF8.java
+7
-4
GenerateDoc.java
h2/src/tools/org/h2/tools/doc/GenerateDoc.java
+5
-5
LinkChecker.java
h2/src/tools/org/h2/tools/doc/LinkChecker.java
+1
-1
SpellChecker.java
h2/src/tools/org/h2/tools/doc/SpellChecker.java
+48
-31
XMLChecker.java
h2/src/tools/org/h2/tools/doc/XMLChecker.java
+5
-5
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+293
-4
HtmlConverter.java
h2/src/tools/org/h2/tools/indexer/HtmlConverter.java
+35
-3
Indexer.java
h2/src/tools/org/h2/tools/indexer/Indexer.java
+4
-4
H2Adapter.java.txt
h2/src/tools/org/h2/tools/jpox/H2Adapter.java.txt
+9
-9
H2Dialect.java.txt
h2/src/tools/org/hibernate/dialect/H2Dialect.java.txt
+7
-7
没有找到文件。
h2/src/tools/org/apache/openjpa/jdbc/sql/H2Dictionary.java.txt
浏览文件 @
0ea30d28
...
...
@@ -106,12 +106,12 @@ public class H2Dictionary extends DBDictionary {
buf.append(", ").append(pkStr);
}
Unique[] un
q
s = table.getUniques();
String un
q
Str;
for (int i = 0; i < un
q
s.length; i++) {
un
qStr = getUniqueConstraintSQL(unq
s[i]);
if (un
q
Str != null)
buf.append(", ").append(un
q
Str);
Unique[] un
ique
s = table.getUniques();
String un
ique
Str;
for (int i = 0; i < un
ique
s.length; i++) {
un
iqueStr = getUniqueConstraintSQL(unique
s[i]);
if (un
ique
Str != null)
buf.append(", ").append(un
ique
Str);
}
buf.append(")");
...
...
@@ -154,12 +154,12 @@ public class H2Dictionary extends DBDictionary {
return cols;
}
public void setDouble(PreparedStatement st
mn
t, int idx, double val, Column col) throws SQLException {
super.setDouble(st
mn
t, idx, val, col);
public void setDouble(PreparedStatement st
a
t, int idx, double val, Column col) throws SQLException {
super.setDouble(st
a
t, idx, val, col);
}
public void setBigDecimal(PreparedStatement st
mn
t, int idx, BigDecimal val, Column col) throws SQLException {
super.setBigDecimal(st
mn
t, idx, val, col);
public void setBigDecimal(PreparedStatement st
a
t, int idx, BigDecimal val, Column col) throws SQLException {
super.setBigDecimal(st
a
t, idx, val, col);
}
protected void appendSelectRange(SQLBuffer buf, long start, long end) {
...
...
h2/src/tools/org/h2/tools/code/CodeSwitch.java
浏览文件 @
0ea30d28
...
...
@@ -68,8 +68,8 @@ public class CodeSwitch {
System
.
out
.
println
(
"labels in the source code are shown."
);
System
.
out
.
println
(
"-r+ recurse subdirectories (default)"
);
System
.
out
.
println
(
"-r- do not recurse subdirectories"
);
System
.
out
.
println
(
"Use +MODE to switch on
the things label
d MODE"
);
System
.
out
.
println
(
"Use -MODE to switch off
the things label
d MODE"
);
System
.
out
.
println
(
"Use +MODE to switch on
code labele
d MODE"
);
System
.
out
.
println
(
"Use -MODE to switch off
code labele
d MODE"
);
System
.
out
.
println
(
"Path: Any number of path or files may be specified."
);
System
.
out
...
...
@@ -164,7 +164,7 @@ public class CodeSwitch {
private
boolean
processFile
(
String
name
)
{
File
f
=
new
File
(
name
);
boolean
switch
off
=
false
;
boolean
off
=
false
;
boolean
working
=
false
;
int
state
=
0
;
try
{
...
...
@@ -233,11 +233,11 @@ public class CodeSwitch {
}
if
(
switchedOn
)
{
working
=
true
;
switch
off
=
false
;
off
=
false
;
}
else
if
(
switchedOff
)
{
working
=
true
;
insertLine
(++
i
,
"/*"
+
endOfLine
);
switch
off
=
true
;
off
=
true
;
}
if
(
switches
.
indexOf
(
s
)
==
-
1
)
{
switches
.
add
(
s
);
...
...
@@ -249,12 +249,12 @@ public class CodeSwitch {
}
state
=
2
;
if
(
working
)
{
if
(
switch
off
)
{
if
(
off
)
{
insertLine
(++
i
,
"*/"
+
endOfLine
);
switch
off
=
false
;
off
=
false
;
}
else
{
insertLine
(++
i
,
"/*"
+
endOfLine
);
switch
off
=
true
;
off
=
true
;
}
}
}
else
if
(
lineTrim
.
startsWith
(
"//#endif"
))
{
...
...
@@ -263,7 +263,7 @@ public class CodeSwitch {
return
false
;
}
state
=
0
;
if
(
working
&&
switch
off
)
{
if
(
working
&&
off
)
{
insertLine
(
i
++,
"*/"
+
endOfLine
);
}
working
=
false
;
...
...
@@ -275,18 +275,18 @@ public class CodeSwitch {
return
false
;
}
if
(
changed
)
{
File
f
n
ew
=
new
File
(
name
+
".new"
);
FileWriter
write
=
new
FileWriter
(
f
n
ew
);
File
f
ileN
ew
=
new
File
(
name
+
".new"
);
FileWriter
write
=
new
FileWriter
(
f
ileN
ew
);
for
(
int
i
=
0
;
i
<
lines
.
size
();
i
++)
{
write
.
write
(
getLine
(
i
));
}
write
.
close
();
File
f
ba
k
=
new
File
(
name
+
".bak"
);
f
ba
k
.
delete
();
f
.
renameTo
(
f
ba
k
);
File
f
c
opy
=
new
File
(
name
);
f
new
.
renameTo
(
fc
opy
);
f
ba
k
.
delete
();
File
f
ileBac
k
=
new
File
(
name
+
".bak"
);
f
ileBac
k
.
delete
();
f
.
renameTo
(
f
ileBac
k
);
File
f
ileC
opy
=
new
File
(
name
);
f
ileNew
.
renameTo
(
fileC
opy
);
f
ileBac
k
.
delete
();
System
.
out
.
println
(
name
);
}
return
true
;
...
...
h2/src/tools/org/h2/tools/code/PropertiesToUTF8.java
浏览文件 @
0ea30d28
...
...
@@ -12,13 +12,15 @@ import java.io.OutputStreamWriter;
import
java.io.RandomAccessFile
;
import
org.h2.server.web.PageParser
;
import
org.h2.tools.indexer.HtmlConverter
;
import
org.h2.util.IOUtils
;
import
org.h2.util.StringUtils
;
public
class
PropertiesToUTF8
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
[]
list
=
new
File
(
"bin/org/h2/web/res"
).
listFiles
();
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++)
{
File
[]
list
=
new
File
(
"bin/org/h2/
server/
web/res"
).
listFiles
();
for
(
int
i
=
0
;
list
!=
null
&&
i
<
list
.
length
;
i
++)
{
File
f
=
list
[
i
];
if
(!
f
.
getName
().
endsWith
(
".properties"
))
{
continue
;
...
...
@@ -29,13 +31,14 @@ public class PropertiesToUTF8 {
in
.
close
();
String
name
=
f
.
getName
();
if
(
name
.
startsWith
(
"utf8"
))
{
s
=
PageParser
.
escapeHtml
(
s
,
false
);
s
=
HtmlConverter
.
convertStringToHtml
(
s
);
RandomAccessFile
out
=
new
RandomAccessFile
(
name
.
substring
(
4
),
"rw"
);
out
.
write
(
s
.
getBytes
());
out
.
close
();
}
else
{
new
CheckTextFiles
().
checkOrFixFile
(
f
,
false
,
false
);
s
=
unescapeHtml
(
s
);
s
=
HtmlConverter
.
convertHtmlToString
(
s
);
// s = unescapeHtml(s);
s
=
StringUtils
.
javaDecode
(
s
);
FileOutputStream
out
=
new
FileOutputStream
(
"utf8"
+
f
.
getName
());
OutputStreamWriter
w
=
new
OutputStreamWriter
(
out
,
"UTF-8"
);
...
...
h2/src/tools/org/h2/tools/doc/GenerateDoc.java
浏览文件 @
0ea30d28
...
...
@@ -71,13 +71,13 @@ public class GenerateDoc {
}
void
process
(
String
fileName
)
throws
Exception
{
FileOutputStream
f
out
=
new
FileOutputStream
(
outDir
+
"/"
+
fileName
+
".html"
);
FileInputStream
f
in
=
new
FileInputStream
(
inDir
+
"/"
+
fileName
+
".jsp"
);
byte
[]
bytes
=
IOUtils
.
readBytesAndClose
(
f
in
,
0
);
FileOutputStream
out
=
new
FileOutputStream
(
outDir
+
"/"
+
fileName
+
".html"
);
FileInputStream
in
=
new
FileInputStream
(
inDir
+
"/"
+
fileName
+
".jsp"
);
byte
[]
bytes
=
IOUtils
.
readBytesAndClose
(
in
,
0
);
String
page
=
new
String
(
bytes
);
page
=
PageParser
.
parse
(
null
,
page
,
session
);
f
out
.
write
(
page
.
getBytes
());
f
out
.
close
();
out
.
write
(
page
.
getBytes
());
out
.
close
();
}
void
map
(
String
key
,
String
sql
)
throws
Exception
{
...
...
h2/src/tools/org/h2/tools/doc/LinkChecker.java
浏览文件 @
0ea30d28
...
...
@@ -163,7 +163,7 @@ public class LinkChecker {
}
else
if
(
type
.
equals
(
"name"
))
{
targets
.
put
(
path
+
"#"
+
ref
,
"name"
);
}
else
{
error
(
fileName
,
"unsupported <a
xxx
: "
+
html
.
substring
(
idx
,
idx
+
100
));
error
(
fileName
,
"unsupported <a
?
: "
+
html
.
substring
(
idx
,
idx
+
100
));
}
}
}
...
...
h2/src/tools/org/h2/tools/doc/SpellChecker.java
浏览文件 @
0ea30d28
...
...
@@ -5,6 +5,7 @@ import java.io.FileReader;
import
java.io.IOException
;
import
java.io.Reader
;
import
java.io.StringWriter
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
...
...
@@ -18,6 +19,7 @@ public class SpellChecker {
private
HashSet
used
=
new
HashSet
();
private
HashMap
unknown
=
new
HashMap
();
private
boolean
debug
;
private
boolean
printDictionary
;
private
boolean
addToDictionary
;
private
static
final
String
[]
SUFFIX
=
new
String
[]{
"java"
,
"sql"
,
"cpp"
,
"txt"
,
"html"
,
"xml"
,
"jsp"
,
"css"
,
"bat"
,
"nsi"
,
"csv"
,
"xml"
,
"js"
,
"def"
,
"dev"
,
"h"
,
"Driver"
,
"properties"
,
"win"
,
"task"
,
"php"
,
""
};
private
static
final
String
[]
IGNORE
=
new
String
[]{
"gif"
,
"png"
,
"odg"
,
"ico"
,
"sxd"
,
"zip"
,
"bz2"
,
"rc"
,
"layout"
,
"res"
,
"dll"
,
"jar"
};
...
...
@@ -30,22 +32,37 @@ public class SpellChecker {
private
void
run
(
String
dictionary
,
String
dir
)
throws
IOException
{
process
(
new
File
(
dir
+
"/"
+
dictionary
));
process
(
new
File
(
dir
));
System
.
out
.
println
(
"used words"
);
for
(
Iterator
it
=
used
.
iterator
();
it
.
hasNext
();)
{
String
s
=
(
String
)
it
.
next
();
System
.
out
.
print
(
s
+
" "
);
}
System
.
out
.
println
();
System
.
out
.
println
(
"ALL UNKNOWN ----------------------------"
);
for
(
Iterator
it
=
unknown
.
keySet
().
iterator
();
it
.
hasNext
();)
{
String
s
=
(
String
)
it
.
next
();
int
count
=
((
Integer
)
unknown
.
get
(
s
)).
intValue
();
if
(
count
>
5
)
{
System
.
out
.
print
(
s
+
" "
);
if
(
printDictionary
)
{
System
.
out
.
println
(
"USED WORDS"
);
String
[]
list
=
new
String
[
used
.
size
()];
used
.
toArray
(
list
);
Arrays
.
sort
(
list
);
StringBuffer
buff
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++)
{
String
s
=
list
[
i
];
if
(
buff
.
length
()
>
0
)
{
if
(
buff
.
length
()
+
s
.
length
()
>
80
)
{
System
.
out
.
println
(
buff
.
toString
());
buff
.
setLength
(
0
);
}
else
{
buff
.
append
(
' '
);
}
}
buff
.
append
(
s
);
}
System
.
out
.
println
(
buff
.
toString
());
}
System
.
out
.
println
();
if
(
unknown
.
size
()
>
0
)
{
System
.
out
.
println
();
System
.
out
.
println
(
"UNKNOWN WORDS"
);
for
(
Iterator
it
=
unknown
.
keySet
().
iterator
();
it
.
hasNext
();)
{
String
s
=
(
String
)
it
.
next
();
int
count
=
((
Integer
)
unknown
.
get
(
s
)).
intValue
();
if
(
count
>
5
)
{
System
.
out
.
print
(
s
+
" "
);
}
}
System
.
out
.
println
();
throw
new
IOException
(
"spell check failed"
);
}
}
...
...
@@ -57,9 +74,9 @@ public class SpellChecker {
}
int
removeThisLater
;
if
(
name
.
indexOf
(
"\\test\\"
)
>=
0
)
{
return
;
}
//
if(name.indexOf("\\test\\") >= 0) {
//
return;
//
}
if
(
file
.
isDirectory
())
{
File
[]
list
=
file
.
listFiles
();
...
...
@@ -115,7 +132,7 @@ public class SpellChecker {
}
private
void
scan
(
String
fileName
,
String
text
)
{
HashSet
not
f
ound
=
new
HashSet
();
HashSet
not
F
ound
=
new
HashSet
();
StringTokenizer
tokenizer
=
new
StringTokenizer
(
text
,
"\r\n \t+\"*%&/()='[]{},.-;:_<>\\!?$@#|~^`"
);
while
(
tokenizer
.
hasMoreTokens
())
{
String
token
=
tokenizer
.
nextToken
();
...
...
@@ -126,17 +143,17 @@ public class SpellChecker {
if
(!
addToDictionary
&&
debug
)
{
System
.
out
.
print
(
token
+
" "
);
}
scanCombinedToken
(
not
f
ound
,
token
);
scanCombinedToken
(
not
F
ound
,
token
);
if
(!
addToDictionary
&&
debug
)
{
System
.
out
.
println
();
}
}
if
(
not
f
ound
.
isEmpty
())
{
if
(
not
F
ound
.
isEmpty
())
{
return
;
}
if
(
not
f
ound
.
size
()
>
0
)
{
if
(
not
F
ound
.
size
()
>
0
)
{
System
.
out
.
println
(
"file: "
+
fileName
);
for
(
Iterator
it
=
not
f
ound
.
iterator
();
it
.
hasNext
();)
{
for
(
Iterator
it
=
not
F
ound
.
iterator
();
it
.
hasNext
();)
{
String
s
=
(
String
)
it
.
next
();
System
.
out
.
print
(
s
+
" "
);
}
...
...
@@ -144,24 +161,24 @@ public class SpellChecker {
}
}
private
void
scanCombinedToken
(
HashSet
not
f
ound
,
String
token
)
{
private
void
scanCombinedToken
(
HashSet
not
F
ound
,
String
token
)
{
for
(
int
i
=
1
;
i
<
token
.
length
();
i
++)
{
char
c
l
eft
=
token
.
charAt
(
i
-
1
);
char
c
r
ight
=
token
.
charAt
(
i
);
if
(
Character
.
isLowerCase
(
c
left
)
&&
Character
.
isUpperCase
(
cr
ight
))
{
scanToken
(
not
f
ound
,
token
.
substring
(
0
,
i
));
char
c
harL
eft
=
token
.
charAt
(
i
-
1
);
char
c
harR
ight
=
token
.
charAt
(
i
);
if
(
Character
.
isLowerCase
(
c
harLeft
)
&&
Character
.
isUpperCase
(
charR
ight
))
{
scanToken
(
not
F
ound
,
token
.
substring
(
0
,
i
));
token
=
token
.
substring
(
i
);
i
=
1
;
}
else
if
(
Character
.
isUpperCase
(
c
left
)
&&
Character
.
isLowerCase
(
cr
ight
))
{
scanToken
(
not
f
ound
,
token
.
substring
(
0
,
i
-
1
));
}
else
if
(
Character
.
isUpperCase
(
c
harLeft
)
&&
Character
.
isLowerCase
(
charR
ight
))
{
scanToken
(
not
F
ound
,
token
.
substring
(
0
,
i
-
1
));
token
=
token
.
substring
(
i
-
1
);
i
=
1
;
}
}
scanToken
(
not
f
ound
,
token
);
scanToken
(
not
F
ound
,
token
);
}
private
void
scanToken
(
HashSet
not
f
ound
,
String
token
)
{
private
void
scanToken
(
HashSet
not
F
ound
,
String
token
)
{
if
(
token
.
length
()
<
3
)
{
return
;
}
...
...
@@ -188,7 +205,7 @@ public class SpellChecker {
dictionary
.
add
(
token
);
}
else
{
if
(!
dictionary
.
contains
(
token
))
{
not
f
ound
.
add
(
token
);
not
F
ound
.
add
(
token
);
increment
(
unknown
,
token
);
}
else
{
used
.
add
(
token
);
...
...
h2/src/tools/org/h2/tools/doc/XMLChecker.java
浏览文件 @
0ea30d28
...
...
@@ -89,7 +89,7 @@ public class XMLChecker {
private
static
void
checkXML
(
String
xml
,
boolean
html
)
throws
Exception
{
String
lastElement
=
null
;
String
[]
no
c
lose
=
new
String
[]{
String
[]
no
C
lose
=
new
String
[]{
"li"
,
"link"
,
"meta"
,
"br"
,
"img"
,
"input"
,
"hr"
,
"frame"
};
XMLParser
parser
=
new
XMLParser
(
xml
);
...
...
@@ -110,8 +110,8 @@ public class XMLChecker {
if
(
html
&&
name
.
equals
(
"table"
)
&&
lastElement
.
trim
().
length
()
>
0
)
{
throw
new
Exception
(
"Test before table: "
+
lastElement
);
}
for
(
int
i
=
0
;
html
&&
i
<
no
c
lose
.
length
;
i
++)
{
if
(
name
.
equals
(
no
c
lose
[
i
]))
{
for
(
int
i
=
0
;
html
&&
i
<
no
C
lose
.
length
;
i
++)
{
if
(
name
.
equals
(
no
C
lose
[
i
]))
{
name
=
null
;
break
;
}
...
...
@@ -121,8 +121,8 @@ public class XMLChecker {
}
}
else
if
(
event
==
XMLParser
.
END_ELEMENT
)
{
String
name
=
parser
.
getName
();
for
(
int
i
=
0
;
html
&&
i
<
no
c
lose
.
length
;
i
++)
{
if
(
name
.
equals
(
no
c
lose
[
i
]))
{
for
(
int
i
=
0
;
html
&&
i
<
no
C
lose
.
length
;
i
++)
{
if
(
name
.
equals
(
no
C
lose
[
i
]))
{
throw
new
Exception
(
"Unnecessary closing element "
+
name
+
" at "
+
parser
.
getRemaining
());
}
}
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
0ea30d28
差异被折叠。
点击展开。
h2/src/tools/org/h2/tools/indexer/HtmlConverter.java
浏览文件 @
0ea30d28
...
...
@@ -8,6 +8,7 @@ import java.util.HashMap;
public
class
HtmlConverter
{
private
static
HashMap
charMap
=
new
HashMap
();
private
static
HashMap
codeMap
=
new
HashMap
();
private
static
final
String
[]
CHARS
=
{
"quot:34"
,
"amp:38"
,
"lt:60"
,
"gt:62"
,
"nbsp:160"
,
"iexcl:161"
,
"cent:162"
,
...
...
@@ -58,11 +59,43 @@ public class HtmlConverter {
int
idx
=
token
.
indexOf
(
':'
);
String
key
=
token
.
substring
(
0
,
idx
);
int
ch
=
Integer
.
parseInt
(
token
.
substring
(
idx
+
1
));
charMap
.
put
(
key
,
new
Character
((
char
)
ch
));
Character
character
=
new
Character
((
char
)
ch
);
charMap
.
put
(
key
,
character
);
codeMap
.
put
(
character
,
key
);
}
}
public
static
String
convertHtml
(
String
html
)
{
public
static
String
convertStringToHtml
(
String
s
)
{
if
(
s
==
null
)
{
return
null
;
}
if
(
s
.
length
()
==
0
)
{
return
s
;
}
StringBuffer
buff
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
s
.
length
();
i
++)
{
char
ch
=
s
.
charAt
(
i
);
Character
c
=
new
Character
(
ch
);
String
token
=
(
String
)
codeMap
.
get
(
c
);
if
(
token
==
null
)
{
if
(
ch
<
128
)
{
buff
.
append
(
ch
);
}
else
{
buff
.
append
(
'&'
);
buff
.
append
(
'#'
);
buff
.
append
((
int
)
ch
);
buff
.
append
(
';'
);
}
}
else
{
buff
.
append
(
'&'
);
buff
.
append
(
token
);
buff
.
append
(
';'
);
}
}
return
buff
.
toString
();
}
public
static
String
convertHtmlToString
(
String
html
)
{
if
(
html
==
null
)
{
return
null
;
}
...
...
@@ -110,6 +143,5 @@ public class HtmlConverter {
}
return
buff
.
toString
();
}
}
h2/src/tools/org/h2/tools/indexer/Indexer.java
浏览文件 @
0ea30d28
...
...
@@ -31,7 +31,7 @@ public class Indexer {
boolean
title
;
boolean
heading
;
private
static
final
int
MIN_WORDSIZE
=
3
;
private
static
final
int
MIN_WORD
_
SIZE
=
3
;
private
static
final
int
MAX_RELATIONS
=
20
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
@@ -222,7 +222,7 @@ public class Indexer {
// buff.append(weight.value);
}
}
// TODO optimization: could support "a name=" and go to _first_ occur
a
nce, or scan page and mark
// TODO optimization: could support "a name=" and go to _first_ occur
re
nce, or scan page and mark
output
.
println
(
"ref['"
+
convertUTF
(
first
)+
"']='"
+
buff
.
toString
()+
"';"
);
output
.
println
(
"// totalRelations: "
+
totalRelations
);
}
...
...
@@ -290,7 +290,7 @@ public class Indexer {
}
void
process
(
String
text
)
{
text
=
HtmlConverter
.
convertHtml
(
text
);
text
=
HtmlConverter
.
convertHtml
ToString
(
text
);
if
(
title
)
{
if
(
page
.
title
==
null
)
{
page
.
title
=
text
;
...
...
@@ -312,7 +312,7 @@ public class Indexer {
false
);
while
(
t
.
hasMoreTokens
())
{
String
token
=
t
.
nextToken
();
if
(
token
.
length
()<
MIN_WORDSIZE
)
{
if
(
token
.
length
()<
MIN_WORD
_
SIZE
)
{
continue
;
}
if
(
Character
.
isDigit
(
token
.
charAt
(
0
)))
{
...
...
h2/src/tools/org/h2/tools/jpox/H2Adapter.java.txt
浏览文件 @
0ea30d28
...
...
@@ -47,7 +47,7 @@ class H2Adapter extends DatabaseAdapter
private String schemaName;
/**
* Constructs a H2 adapter based on the given JDBCmetadata.
* Constructs a H2 adapter based on the given JDBC
metadata.
* @param dictionary The Dictionary to use
* @param metadata the database metadata.
*/
...
...
@@ -75,7 +75,7 @@ class H2Adapter extends DatabaseAdapter
}
/**
*
Accesso
r for the vendor ID for this adapter.
*
Gette
r for the vendor ID for this adapter.
* @return The vendor ID
*/
public String getVendorID()
...
...
@@ -85,7 +85,7 @@ class H2Adapter extends DatabaseAdapter
/**
* Accessor for a Connection to the datastore.
* @param ds The data source. Possible to have more than one data
source for fail
over
* @param ds The data source. Possible to have more than one data
source for fail
over
* @param userName The username for the datastore
* @param password The password for the datastore
* @param isolationLevel The level of transaction isolation
...
...
@@ -149,7 +149,7 @@ class H2Adapter extends DatabaseAdapter
/**
* Method to return the SQL to append to the SELECT clause of a SELECT statement to handle
* restriction of ranges using the LIM
U
T keyword.
* restriction of ranges using the LIM
I
T keyword.
* @param offset The offset to return from
* @param count The number of items to return
* @return The SQL to append to allow for ranges using LIMIT.
...
...
@@ -244,8 +244,8 @@ class H2Adapter extends DatabaseAdapter
}
/**
* Whether we support autoincrementing fields.
* @return whether we support autoincrementing fields.
* Whether we support auto
incrementing fields.
* @return whether we support auto
incrementing fields.
**/
public boolean supportsAutoIncrementFields()
{
...
...
@@ -264,7 +264,7 @@ class H2Adapter extends DatabaseAdapter
}
/**
* Accessor for the auto-increment keyword for generating DDLs (CREATE TABLE
s
...).
* Accessor for the auto-increment keyword for generating DDLs (CREATE TABLE...).
* @return The keyword for a column using auto-increment
**/
public String getAutoIncrementKeyword()
...
...
@@ -273,7 +273,7 @@ class H2Adapter extends DatabaseAdapter
}
/**
* Method to retu
t
n the INSERT statement to use when inserting into a table that has no
* Method to retu
r
n the INSERT statement to use when inserting into a table that has no
* columns specified. This is the case when we have a single column in the table and that column
* is autoincrement/identity (and so is assigned automatically in the datastore).
* @param table The table
...
...
@@ -298,7 +298,7 @@ class H2Adapter extends DatabaseAdapter
* Whether this datastore supports the use of CHECK after the column
* definitions in CREATE TABLE statements (DDL).
* e.g.
* CREATE TABLE X
XX
* CREATE TABLE X
YZ
* (
* COL_A int,
* COL_B char(1),
...
...
h2/src/tools/org/hibernate/dialect/H2Dialect.java.txt
浏览文件 @
0ea30d28
...
...
@@ -28,8 +28,8 @@ public class H2Dialect extends Dialect {
try {
Class constants = ReflectHelper.classForName( "org.h2.engine.Constants" );
Integer build = (Integer)constants.getDeclaredField("BUILD_ID" ).get(null);
int build
i
d = build.intValue();
if(build
i
d < 32) {
int build
I
d = build.intValue();
if(build
I
d < 32) {
querySequenceString = "select name from information_schema.sequences";
}
} catch(Throwable e) {
...
...
@@ -141,7 +141,7 @@ public class H2Dialect extends Dialect {
// registerFunction("minute", new StandardSQLFunction("minute", Hibernate.INTEGER));
// registerFunction("month", new StandardSQLFunction("month", Hibernate.INTEGER));
registerFunction("monthname", new StandardSQLFunction("monthname", Hibernate.STRING));
registerFunction("qua
ter", new StandardSQLFunction("qua
ter", Hibernate.INTEGER));
registerFunction("qua
rter", new StandardSQLFunction("quar
ter", Hibernate.INTEGER));
// registerFunction("second", new StandardSQLFunction("second", Hibernate.INTEGER));
registerFunction("week", new StandardSQLFunction("week", Hibernate.INTEGER));
// registerFunction("year", new StandardSQLFunction("year", Hibernate.INTEGER));
...
...
@@ -246,15 +246,15 @@ public class H2Dialect extends Dialect {
/**
* Extract the name of the violated constraint from the given SQLException.
*
* @param
sql
e The exception that was the result of the constraint violation.
* @param e The exception that was the result of the constraint violation.
* @return The extracted constraint name.
*/
public String extractConstraintName(SQLException
sql
e) {
public String extractConstraintName(SQLException e) {
String constraintName = null;
// 23000: Check constraint violation: {0}
// 23001: Unique index or primary key violation: {0}
if(
sql
e.getSQLState().startsWith("23")) {
String message =
sql
e.getMessage();
if(e.getSQLState().startsWith("23")) {
String message = e.getMessage();
int idx = message.indexOf("violation: ");
if(idx > 0) {
constraintName = message.substring(idx + "violation: ".length());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论