Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4a053407
提交
4a053407
authored
8月 28, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Source code switching using //## has been simplified.
上级
ccabdcb9
全部展开
显示空白字符变更
内嵌
并排
正在显示
36 个修改的文件
包含
140 行增加
和
307 行删除
+140
-307
Console.java
h2/src/main/org/h2/tools/Console.java
+37
-37
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+102
-102
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+0
-8
AnnotationsTest.java
h2/src/test/org/h2/test/jaqu/AnnotationsTest.java
+0
-4
ComplexObject.java
h2/src/test/org/h2/test/jaqu/ComplexObject.java
+0
-4
Customer.java
h2/src/test/org/h2/test/jaqu/Customer.java
+1
-4
ModelsTest.java
h2/src/test/org/h2/test/jaqu/ModelsTest.java
+0
-4
Order.java
h2/src/test/org/h2/test/jaqu/Order.java
+0
-4
Product.java
h2/src/test/org/h2/test/jaqu/Product.java
+0
-4
ProductAnnotationOnly.java
h2/src/test/org/h2/test/jaqu/ProductAnnotationOnly.java
+0
-3
ProductMixedAnnotation.java
h2/src/test/org/h2/test/jaqu/ProductMixedAnnotation.java
+0
-3
ProductNoCreateTable.java
h2/src/test/org/h2/test/jaqu/ProductNoCreateTable.java
+0
-4
SamplesTest.java
h2/src/test/org/h2/test/jaqu/SamplesTest.java
+0
-14
CompareType.java
h2/src/tools/org/h2/jaqu/CompareType.java
+0
-2
Condition.java
h2/src/tools/org/h2/jaqu/Condition.java
+0
-2
ConditionAndOr.java
h2/src/tools/org/h2/jaqu/ConditionAndOr.java
+0
-2
Db.java
h2/src/tools/org/h2/jaqu/Db.java
+0
-4
Define.java
h2/src/tools/org/h2/jaqu/Define.java
+0
-2
Function.java
h2/src/tools/org/h2/jaqu/Function.java
+0
-4
OrderExpression.java
h2/src/tools/org/h2/jaqu/OrderExpression.java
+0
-2
Query.java
h2/src/tools/org/h2/jaqu/Query.java
+0
-10
QueryCondition.java
h2/src/tools/org/h2/jaqu/QueryCondition.java
+0
-2
QueryJoin.java
h2/src/tools/org/h2/jaqu/QueryJoin.java
+0
-2
QueryJoinCondition.java
h2/src/tools/org/h2/jaqu/QueryJoinCondition.java
+0
-2
QueryWhere.java
h2/src/tools/org/h2/jaqu/QueryWhere.java
+0
-6
SQLStatement.java
h2/src/tools/org/h2/jaqu/SQLStatement.java
+0
-4
SelectColumn.java
h2/src/tools/org/h2/jaqu/SelectColumn.java
+0
-4
SelectTable.java
h2/src/tools/org/h2/jaqu/SelectTable.java
+0
-4
TableDefinition.java
h2/src/tools/org/h2/jaqu/TableDefinition.java
+0
-8
TestCondition.java
h2/src/tools/org/h2/jaqu/TestCondition.java
+0
-2
Token.java
h2/src/tools/org/h2/jaqu/Token.java
+0
-2
UpdateColumn.java
h2/src/tools/org/h2/jaqu/UpdateColumn.java
+0
-2
UpdateColumnIncrement.java
h2/src/tools/org/h2/jaqu/UpdateColumnIncrement.java
+0
-2
UpdateColumnSet.java
h2/src/tools/org/h2/jaqu/UpdateColumnSet.java
+0
-2
ClassUtils.java
h2/src/tools/org/h2/jaqu/util/ClassUtils.java
+0
-38
WeakIdentityHashMap.java
h2/src/tools/org/h2/jaqu/util/WeakIdentityHashMap.java
+0
-4
没有找到文件。
h2/src/main/org/h2/tools/Console.java
浏览文件 @
4a053407
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*/
*/
package
org
.
h2
.
tools
;
package
org
.
h2
.
tools
;
//## AWT
begin
##
//## AWT ##
import
java.awt.Button
;
import
java.awt.Button
;
import
java.awt.Dimension
;
import
java.awt.Dimension
;
import
java.awt.Font
;
import
java.awt.Font
;
...
@@ -44,12 +44,12 @@ import org.h2.util.Utils;
...
@@ -44,12 +44,12 @@ import org.h2.util.Utils;
* @author Thomas Mueller, Ridvan Agar
* @author Thomas Mueller, Ridvan Agar
*/
*/
public
class
Console
extends
Tool
implements
public
class
Console
extends
Tool
implements
//## AWT
begin
##
//## AWT ##
ActionListener
,
MouseListener
,
WindowListener
,
ActionListener
,
MouseListener
,
WindowListener
,
//
## AWT end ##
//
*/
ShutdownHandler
{
ShutdownHandler
{
//## AWT
begin
##
//## AWT ##
private
Frame
frame
;
private
Frame
frame
;
private
boolean
trayIconUsed
;
private
boolean
trayIconUsed
;
private
Font
font
;
private
Font
font
;
...
@@ -57,7 +57,7 @@ ShutdownHandler {
...
@@ -57,7 +57,7 @@ ShutdownHandler {
private
TextField
urlText
;
private
TextField
urlText
;
private
Object
tray
;
private
Object
tray
;
private
Object
trayIcon
;
private
Object
trayIcon
;
//
## AWT end ##
//
*/
private
Server
web
,
tcp
,
pg
;
private
Server
web
,
tcp
,
pg
;
private
boolean
isWindows
;
private
boolean
isWindows
;
private
long
lastOpen
;
private
long
lastOpen
;
...
@@ -238,7 +238,7 @@ ShutdownHandler {
...
@@ -238,7 +238,7 @@ ShutdownHandler {
}
}
}
}
//## AWT
begin
##
//## AWT ##
if
(
toolStart
&&
webRunning
&&
!
GraphicsEnvironment
.
isHeadless
())
{
if
(
toolStart
&&
webRunning
&&
!
GraphicsEnvironment
.
isHeadless
())
{
loadFont
();
loadFont
();
try
{
try
{
...
@@ -249,7 +249,7 @@ ShutdownHandler {
...
@@ -249,7 +249,7 @@ ShutdownHandler {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
//
## AWT end ##
//
*/
// start browser in any case (even if the server is already running)
// start browser in any case (even if the server is already running)
// because some people don't look at the output,
// because some people don't look at the output,
...
@@ -332,7 +332,7 @@ ShutdownHandler {
...
@@ -332,7 +332,7 @@ ShutdownHandler {
pg
.
stop
();
pg
.
stop
();
pg
=
null
;
pg
=
null
;
}
}
//## AWT
begin
##
//## AWT ##
if
(
frame
!=
null
)
{
if
(
frame
!=
null
)
{
frame
.
dispose
();
frame
.
dispose
();
frame
=
null
;
frame
=
null
;
...
@@ -350,11 +350,11 @@ ShutdownHandler {
...
@@ -350,11 +350,11 @@ ShutdownHandler {
}
}
System
.
gc
();
System
.
gc
();
}
}
//
## AWT end ##
//
*/
// System.exit(0);
// System.exit(0);
}
}
//## AWT
begin
##
//## AWT ##
private
void
loadFont
()
{
private
void
loadFont
()
{
if
(
isWindows
)
{
if
(
isWindows
)
{
font
=
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
11
);
font
=
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
11
);
...
@@ -519,7 +519,7 @@ ShutdownHandler {
...
@@ -519,7 +519,7 @@ ShutdownHandler {
}
}
}
}
}
}
//
## AWT end ##
//
*/
private
void
openBrowser
(
String
url
)
{
private
void
openBrowser
(
String
url
)
{
try
{
try
{
...
@@ -532,7 +532,7 @@ ShutdownHandler {
...
@@ -532,7 +532,7 @@ ShutdownHandler {
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
actionPerformed
(
ActionEvent
e
)
{
public
void
actionPerformed
(
ActionEvent
e
)
{
String
command
=
e
.
getActionCommand
();
String
command
=
e
.
getActionCommand
();
if
(
"exit"
.
equals
(
command
))
{
if
(
"exit"
.
equals
(
command
))
{
...
@@ -546,59 +546,59 @@ ShutdownHandler {
...
@@ -546,59 +546,59 @@ ShutdownHandler {
startBrowser
();
startBrowser
();
}
}
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
mouseClicked
(
MouseEvent
e
)
{
public
void
mouseClicked
(
MouseEvent
e
)
{
if
(
e
.
getButton
()
==
MouseEvent
.
BUTTON1
)
{
if
(
e
.
getButton
()
==
MouseEvent
.
BUTTON1
)
{
startBrowser
();
startBrowser
();
}
}
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
mouseEntered
(
MouseEvent
e
)
{
public
void
mouseEntered
(
MouseEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
mouseExited
(
MouseEvent
e
)
{
public
void
mouseExited
(
MouseEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
mousePressed
(
MouseEvent
e
)
{
public
void
mousePressed
(
MouseEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
mouseReleased
(
MouseEvent
e
)
{
public
void
mouseReleased
(
MouseEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
windowClosing
(
WindowEvent
e
)
{
public
void
windowClosing
(
WindowEvent
e
)
{
if
(
trayIconUsed
)
{
if
(
trayIconUsed
)
{
frame
.
dispose
();
frame
.
dispose
();
...
@@ -607,60 +607,60 @@ ShutdownHandler {
...
@@ -607,60 +607,60 @@ ShutdownHandler {
shutdown
();
shutdown
();
}
}
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
windowActivated
(
WindowEvent
e
)
{
public
void
windowActivated
(
WindowEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
windowClosed
(
WindowEvent
e
)
{
public
void
windowClosed
(
WindowEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
windowDeactivated
(
WindowEvent
e
)
{
public
void
windowDeactivated
(
WindowEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
windowDeiconified
(
WindowEvent
e
)
{
public
void
windowDeiconified
(
WindowEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
windowIconified
(
WindowEvent
e
)
{
public
void
windowIconified
(
WindowEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
/**
/**
* INTERNAL
* INTERNAL
*/
*/
//## AWT
begin
##
//## AWT ##
public
void
windowOpened
(
WindowEvent
e
)
{
public
void
windowOpened
(
WindowEvent
e
)
{
// nothing to do
// nothing to do
}
}
//
## AWT end ##
//
*/
}
}
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
4a053407
差异被折叠。
点击展开。
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
4a053407
...
@@ -372,7 +372,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -372,7 +372,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
}
private
void
testVarArgs
()
throws
SQLException
{
private
void
testVarArgs
()
throws
SQLException
{
//## Java 1.5 begin ##
Connection
conn
=
getConnection
(
"functions"
);
Connection
conn
=
getConnection
(
"functions"
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"CREATE ALIAS mean FOR \""
+
stat
.
execute
(
"CREATE ALIAS mean FOR \""
+
...
@@ -428,7 +427,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -428,7 +427,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
assertEquals
(
"BB: 15"
,
rs
.
getString
(
3
));
assertEquals
(
"BB: 15"
,
rs
.
getString
(
3
));
assertEquals
(
"CCC: 20"
,
rs
.
getString
(
4
));
assertEquals
(
"CCC: 20"
,
rs
.
getString
(
4
));
conn
.
close
();
conn
.
close
();
//## Java 1.5 end ##
}
}
private
void
testFileRead
()
throws
Exception
{
private
void
testFileRead
()
throws
Exception
{
...
@@ -983,7 +981,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -983,7 +981,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
* @param values the values
* @param values the values
* @return the mean value
* @return the mean value
*/
*/
//## Java 1.5 begin ##
public
static
double
mean
(
double
...
values
)
{
public
static
double
mean
(
double
...
values
)
{
double
sum
=
0
;
double
sum
=
0
;
for
(
double
x
:
values
)
{
for
(
double
x
:
values
)
{
...
@@ -991,7 +988,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -991,7 +988,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
}
return
sum
/
values
.
length
;
return
sum
/
values
.
length
;
}
}
//## Java 1.5 end ##
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
...
@@ -1000,7 +996,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -1000,7 +996,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
* @param values the values
* @param values the values
* @return the mean value
* @return the mean value
*/
*/
//## Java 1.5 begin ##
public
static
double
mean2
(
Connection
conn
,
double
...
values
)
{
public
static
double
mean2
(
Connection
conn
,
double
...
values
)
{
conn
.
getClass
();
conn
.
getClass
();
double
sum
=
0
;
double
sum
=
0
;
...
@@ -1009,7 +1004,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -1009,7 +1004,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
}
return
sum
/
values
.
length
;
return
sum
/
values
.
length
;
}
}
//## Java 1.5 end ##
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
...
@@ -1018,7 +1012,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -1018,7 +1012,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
* @param values the values
* @param values the values
* @return the text
* @return the text
*/
*/
//## Java 1.5 begin ##
public
static
String
printMean
(
String
prefix
,
double
...
values
)
{
public
static
String
printMean
(
String
prefix
,
double
...
values
)
{
double
sum
=
0
;
double
sum
=
0
;
for
(
double
x
:
values
)
{
for
(
double
x
:
values
)
{
...
@@ -1026,7 +1019,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -1026,7 +1019,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
}
return
prefix
+
": "
+
(
int
)
(
sum
/
values
.
length
);
return
prefix
+
": "
+
(
int
)
(
sum
/
values
.
length
);
}
}
//## Java 1.5 end ##
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
...
...
h2/src/test/org/h2/test/jaqu/AnnotationsTest.java
浏览文件 @
4a053407
...
@@ -22,9 +22,7 @@ public class AnnotationsTest extends TestBase {
...
@@ -22,9 +22,7 @@ public class AnnotationsTest extends TestBase {
/**
/**
* This object represents a database (actually a connection to the database).
* This object represents a database (actually a connection to the database).
*/
*/
//## Java 1.5 begin ##
private
Db
db
;
private
Db
db
;
//## Java 1.5 end ##
/**
/**
* This method is called when executing this application from the command
* This method is called when executing this application from the command
...
@@ -37,7 +35,6 @@ public class AnnotationsTest extends TestBase {
...
@@ -37,7 +35,6 @@ public class AnnotationsTest extends TestBase {
}
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
//## Java 1.5 begin ##
db
=
Db
.
open
(
"jdbc:h2:mem:"
,
"sa"
,
"sa"
);
db
=
Db
.
open
(
"jdbc:h2:mem:"
,
"sa"
,
"sa"
);
db
.
insertAll
(
Product
.
getList
());
db
.
insertAll
(
Product
.
getList
());
db
.
insertAll
(
ProductAnnotationOnly
.
getList
());
db
.
insertAll
(
ProductAnnotationOnly
.
getList
());
...
@@ -49,7 +46,6 @@ public class AnnotationsTest extends TestBase {
...
@@ -49,7 +46,6 @@ public class AnnotationsTest extends TestBase {
testCreateTableIfRequiredAnnotation
();
testCreateTableIfRequiredAnnotation
();
testColumnInheritanceAnnotation
();
testColumnInheritanceAnnotation
();
db
.
close
();
db
.
close
();
//## Java 1.5 end ##
}
}
private
void
testIndexCreation
()
throws
SQLException
{
private
void
testIndexCreation
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/jaqu/ComplexObject.java
浏览文件 @
4a053407
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
package
org
.
h2
.
test
.
jaqu
;
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
static
org
.
h2
.
jaqu
.
Define
.*;
import
static
org
.
h2
.
jaqu
.
Define
.*;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -16,12 +15,10 @@ import java.util.List;
...
@@ -16,12 +15,10 @@ import java.util.List;
import
java.sql.Time
;
import
java.sql.Time
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
org.h2.jaqu.Table
;
import
org.h2.jaqu.Table
;
//## Java 1.5 end ##
/**
/**
* A table containing all possible data types.
* A table containing all possible data types.
*/
*/
//## Java 1.5 begin ##
public
class
ComplexObject
implements
Table
{
public
class
ComplexObject
implements
Table
{
public
Integer
id
;
public
Integer
id
;
public
Long
amount
;
public
Long
amount
;
...
@@ -52,4 +49,3 @@ public class ComplexObject implements Table {
...
@@ -52,4 +49,3 @@ public class ComplexObject implements Table {
}
}
}
}
//## Java 1.5 end ##
h2/src/test/org/h2/test/jaqu/Customer.java
浏览文件 @
4a053407
...
@@ -6,10 +6,8 @@
...
@@ -6,10 +6,8 @@
*/
*/
package
org
.
h2
.
test
.
jaqu
;
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
//## Java 1.5 end ##
/**
/**
* A table containing customer data.
* A table containing customer data.
...
@@ -32,7 +30,6 @@ public class Customer {
...
@@ -32,7 +30,6 @@ public class Customer {
return
customerId
;
return
customerId
;
}
}
//## Java 1.5 begin ##
public
static
List
<
Customer
>
getList
()
{
public
static
List
<
Customer
>
getList
()
{
Customer
[]
list
=
{
Customer
[]
list
=
{
new
Customer
(
"ALFKI"
,
"WA"
),
new
Customer
(
"ALFKI"
,
"WA"
),
...
@@ -40,5 +37,5 @@ public class Customer {
...
@@ -40,5 +37,5 @@ public class Customer {
new
Customer
(
"ANTON"
,
"CA"
)
};
new
Customer
(
"ANTON"
,
"CA"
)
};
return
Arrays
.
asList
(
list
);
return
Arrays
.
asList
(
list
);
}
}
//## Java 1.5 end ##
}
}
h2/src/test/org/h2/test/jaqu/ModelsTest.java
浏览文件 @
4a053407
...
@@ -25,9 +25,7 @@ public class ModelsTest extends TestBase {
...
@@ -25,9 +25,7 @@ public class ModelsTest extends TestBase {
/**
/**
* This object represents a database (actually a connection to the database).
* This object represents a database (actually a connection to the database).
*/
*/
//## Java 1.5 begin ##
private
Db
db
;
private
Db
db
;
//## Java 1.5 end ##
/**
/**
* This method is called when executing this application from the command
* This method is called when executing this application from the command
...
@@ -43,7 +41,6 @@ public class ModelsTest extends TestBase {
...
@@ -43,7 +41,6 @@ public class ModelsTest extends TestBase {
}
}
public
void
test
()
{
public
void
test
()
{
//## Java 1.5 begin ##
db
=
Db
.
open
(
"jdbc:h2:mem:"
,
"sa"
,
"sa"
);
db
=
Db
.
open
(
"jdbc:h2:mem:"
,
"sa"
,
"sa"
);
db
.
insertAll
(
Product
.
getList
());
db
.
insertAll
(
Product
.
getList
());
db
.
insertAll
(
ProductAnnotationOnly
.
getList
());
db
.
insertAll
(
ProductAnnotationOnly
.
getList
());
...
@@ -54,7 +51,6 @@ public class ModelsTest extends TestBase {
...
@@ -54,7 +51,6 @@ public class ModelsTest extends TestBase {
testDatabaseUpgrade
();
testDatabaseUpgrade
();
testTableUpgrade
();
testTableUpgrade
();
db
.
close
();
db
.
close
();
//## Java 1.5 end ##
}
}
private
void
testValidateModels
()
{
private
void
testValidateModels
()
{
...
...
h2/src/test/org/h2/test/jaqu/Order.java
浏览文件 @
4a053407
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
package
org
.
h2
.
test
.
jaqu
;
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
static
org
.
h2
.
jaqu
.
Define
.*;
import
static
org
.
h2
.
jaqu
.
Define
.*;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -15,12 +14,10 @@ import java.util.Date;
...
@@ -15,12 +14,10 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
org.h2.jaqu.Table
;
import
org.h2.jaqu.Table
;
//## Java 1.5 end ##
/**
/**
* A table containing order data.
* A table containing order data.
*/
*/
//## Java 1.5 begin ##
public
class
Order
implements
Table
{
public
class
Order
implements
Table
{
public
String
customerId
;
public
String
customerId
;
...
@@ -59,4 +56,3 @@ public class Order implements Table {
...
@@ -59,4 +56,3 @@ public class Order implements Table {
}
}
}
}
//## Java 1.5 end ##
h2/src/test/org/h2/test/jaqu/Product.java
浏览文件 @
4a053407
...
@@ -6,19 +6,16 @@
...
@@ -6,19 +6,16 @@
*/
*/
package
org
.
h2
.
test
.
jaqu
;
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
org.h2.jaqu.Table
;
import
org.h2.jaqu.Table
;
import
static
org
.
h2
.
jaqu
.
Define
.*;
import
static
org
.
h2
.
jaqu
.
Define
.*;
//## Java 1.5 end ##
/**
/**
* A table containing product data.
* A table containing product data.
*/
*/
//## Java 1.5 begin ##
public
class
Product
implements
Table
{
public
class
Product
implements
Table
{
public
Integer
productId
;
public
Integer
productId
;
...
@@ -75,4 +72,3 @@ public class Product implements Table {
...
@@ -75,4 +72,3 @@ public class Product implements Table {
}
}
}
}
//## Java 1.5 end ##
h2/src/test/org/h2/test/jaqu/ProductAnnotationOnly.java
浏览文件 @
4a053407
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
package
org
.
h2
.
test
.
jaqu
;
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
org.h2.jaqu.Table.JQColumn
;
import
org.h2.jaqu.Table.JQColumn
;
...
@@ -16,7 +15,6 @@ import org.h2.jaqu.Table.JQTable;
...
@@ -16,7 +15,6 @@ import org.h2.jaqu.Table.JQTable;
/**
/**
* A table containing product data.
* A table containing product data.
*/
*/
//## Java 1.5 begin ##
@JQTable
(
name
=
"AnnotatedProduct"
,
primaryKey
=
"id"
)
@JQTable
(
name
=
"AnnotatedProduct"
,
primaryKey
=
"id"
)
@JQIndex
(
standard
=
"name, cat"
)
@JQIndex
(
standard
=
"name, cat"
)
public
class
ProductAnnotationOnly
{
public
class
ProductAnnotationOnly
{
...
@@ -81,4 +79,3 @@ public class ProductAnnotationOnly {
...
@@ -81,4 +79,3 @@ public class ProductAnnotationOnly {
}
}
}
}
//## Java 1.5 end ##
h2/src/test/org/h2/test/jaqu/ProductMixedAnnotation.java
浏览文件 @
4a053407
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
package
org
.
h2
.
test
.
jaqu
;
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
org.h2.jaqu.Table.JQColumn
;
import
org.h2.jaqu.Table.JQColumn
;
...
@@ -16,7 +15,6 @@ import org.h2.jaqu.Table.JQTable;
...
@@ -16,7 +15,6 @@ import org.h2.jaqu.Table.JQTable;
/**
/**
* A table containing product data.
* A table containing product data.
*/
*/
//## Java 1.5 begin ##
@JQTable
(
annotationsOnly
=
false
)
@JQTable
(
annotationsOnly
=
false
)
@JQIndex
(
standard
=
"name, cat"
)
@JQIndex
(
standard
=
"name, cat"
)
public
class
ProductMixedAnnotation
{
public
class
ProductMixedAnnotation
{
...
@@ -81,4 +79,3 @@ public class ProductMixedAnnotation {
...
@@ -81,4 +79,3 @@ public class ProductMixedAnnotation {
}
}
}
}
//## Java 1.5 end ##
h2/src/test/org/h2/test/jaqu/ProductNoCreateTable.java
浏览文件 @
4a053407
...
@@ -6,17 +6,14 @@
...
@@ -6,17 +6,14 @@
*/
*/
package
org
.
h2
.
test
.
jaqu
;
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
org.h2.jaqu.Table.JQColumn
;
import
org.h2.jaqu.Table.JQColumn
;
import
org.h2.jaqu.Table.JQTable
;
import
org.h2.jaqu.Table.JQTable
;
//## Java 1.5 end ##
/**
/**
* A table containing product data.
* A table containing product data.
*/
*/
//## Java 1.5 begin ##
@JQTable
(
createIfRequired
=
false
)
@JQTable
(
createIfRequired
=
false
)
public
class
ProductNoCreateTable
{
public
class
ProductNoCreateTable
{
...
@@ -47,4 +44,3 @@ public class ProductNoCreateTable {
...
@@ -47,4 +44,3 @@ public class ProductNoCreateTable {
}
}
}
}
//## Java 1.5 end ##
h2/src/test/org/h2/test/jaqu/SamplesTest.java
浏览文件 @
4a053407
...
@@ -30,9 +30,7 @@ public class SamplesTest extends TestBase {
...
@@ -30,9 +30,7 @@ public class SamplesTest extends TestBase {
/**
/**
* This object represents a database (actually a connection to the database).
* This object represents a database (actually a connection to the database).
*/
*/
//## Java 1.5 begin ##
Db
db
;
Db
db
;
//## Java 1.5 end ##
/**
/**
* This method is called when executing this application from the command
* This method is called when executing this application from the command
...
@@ -45,7 +43,6 @@ public class SamplesTest extends TestBase {
...
@@ -45,7 +43,6 @@ public class SamplesTest extends TestBase {
}
}
public
void
test
()
{
public
void
test
()
{
//## Java 1.5 begin ##
db
=
Db
.
open
(
"jdbc:h2:mem:"
,
"sa"
,
"sa"
);
db
=
Db
.
open
(
"jdbc:h2:mem:"
,
"sa"
,
"sa"
);
db
.
insertAll
(
Product
.
getList
());
db
.
insertAll
(
Product
.
getList
());
db
.
insertAll
(
Customer
.
getList
());
db
.
insertAll
(
Customer
.
getList
());
...
@@ -81,7 +78,6 @@ public class SamplesTest extends TestBase {
...
@@ -81,7 +78,6 @@ public class SamplesTest extends TestBase {
testLimitOffset
();
testLimitOffset
();
testKeyRetrieval
();
testKeyRetrieval
();
db
.
close
();
db
.
close
();
//## Java 1.5 end ##
}
}
/**
/**
...
@@ -93,7 +89,6 @@ public class SamplesTest extends TestBase {
...
@@ -93,7 +89,6 @@ public class SamplesTest extends TestBase {
public
Integer
id
;
public
Integer
id
;
}
}
//## Java 1.5 begin ##
private
void
testReverseColumns
()
{
private
void
testReverseColumns
()
{
db
.
executeUpdate
(
"create table TestReverse(id int, name varchar, additional varchar)"
);
db
.
executeUpdate
(
"create table TestReverse(id int, name varchar, additional varchar)"
);
TestReverse
t
=
new
TestReverse
();
TestReverse
t
=
new
TestReverse
();
...
@@ -104,10 +99,8 @@ public class SamplesTest extends TestBase {
...
@@ -104,10 +99,8 @@ public class SamplesTest extends TestBase {
assertEquals
(
t
.
name
,
check
.
name
);
assertEquals
(
t
.
name
,
check
.
name
);
assertEquals
(
t
.
id
,
check
.
id
);
assertEquals
(
t
.
id
,
check
.
id
);
}
}
//## Java 1.5 end ##
//## Java 1.5 begin ##
private
void
testWhereSimple2
()
{
private
void
testWhereSimple2
()
{
// var soldOutProducts =
// var soldOutProducts =
...
@@ -175,7 +168,6 @@ public class SamplesTest extends TestBase {
...
@@ -175,7 +168,6 @@ public class SamplesTest extends TestBase {
assertEquals
(
products
.
get
(
i
).
productName
,
productNames
.
get
(
i
));
assertEquals
(
products
.
get
(
i
).
productName
,
productNames
.
get
(
i
));
}
}
}
}
//## Java 1.5 end ##
/**
/**
* A result set class containing the product name and price.
* A result set class containing the product name and price.
...
@@ -186,7 +178,6 @@ public class SamplesTest extends TestBase {
...
@@ -186,7 +178,6 @@ public class SamplesTest extends TestBase {
public
Double
price
;
public
Double
price
;
}
}
//## Java 1.5 begin ##
private
void
testAnonymousTypes3
()
{
private
void
testAnonymousTypes3
()
{
// var productInfos =
// var productInfos =
...
@@ -216,7 +207,6 @@ public class SamplesTest extends TestBase {
...
@@ -216,7 +207,6 @@ public class SamplesTest extends TestBase {
assertEquals
(
p2
.
unitPrice
,
pr
.
price
);
assertEquals
(
p2
.
unitPrice
,
pr
.
price
);
}
}
}
}
//## Java 1.5 end ##
/**
/**
* A result set class containing customer data and the order total.
* A result set class containing customer data and the order total.
...
@@ -230,7 +220,6 @@ public class SamplesTest extends TestBase {
...
@@ -230,7 +220,6 @@ public class SamplesTest extends TestBase {
}
}
}
}
//## Java 1.5 begin ##
private
void
testSelectManyCompoundFrom2
()
{
private
void
testSelectManyCompoundFrom2
()
{
// var orders =
// var orders =
...
@@ -407,7 +396,6 @@ public class SamplesTest extends TestBase {
...
@@ -407,7 +396,6 @@ public class SamplesTest extends TestBase {
assertTrue
(
"Failed to add key. Duplicate?"
,
uniqueKeys
.
add
(
l
));
assertTrue
(
"Failed to add key. Duplicate?"
,
uniqueKeys
.
add
(
l
));
}
}
}
}
//## Java 1.5 end ##
/**
/**
* A result set class containing product groups.
* A result set class containing product groups.
...
@@ -420,7 +408,6 @@ public class SamplesTest extends TestBase {
...
@@ -420,7 +408,6 @@ public class SamplesTest extends TestBase {
}
}
}
}
//## Java 1.5 begin ##
private
void
testGroup
()
{
private
void
testGroup
()
{
// var orderGroups =
// var orderGroups =
...
@@ -446,5 +433,4 @@ public class SamplesTest extends TestBase {
...
@@ -446,5 +433,4 @@ public class SamplesTest extends TestBase {
list
.
toString
());
list
.
toString
());
}
}
//## Java 1.5 end ##
}
}
h2/src/tools/org/h2/jaqu/CompareType.java
浏览文件 @
4a053407
...
@@ -9,7 +9,6 @@ package org.h2.jaqu;
...
@@ -9,7 +9,6 @@ package org.h2.jaqu;
/**
/**
* An enumeration of compare operations.
* An enumeration of compare operations.
*/
*/
//## Java 1.5 begin ##
enum
CompareType
{
enum
CompareType
{
EQUAL
(
"="
,
true
),
EQUAL
(
"="
,
true
),
BIGGER
(
">"
,
true
),
BIGGER
(
">"
,
true
),
...
@@ -38,5 +37,4 @@ enum CompareType {
...
@@ -38,5 +37,4 @@ enum CompareType {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/Condition.java
浏览文件 @
4a053407
...
@@ -11,7 +11,6 @@ package org.h2.jaqu;
...
@@ -11,7 +11,6 @@ package org.h2.jaqu;
*
*
* @param <A> the operand type
* @param <A> the operand type
*/
*/
//## Java 1.5 begin ##
class
Condition
<
A
>
implements
Token
{
class
Condition
<
A
>
implements
Token
{
CompareType
compareType
;
CompareType
compareType
;
A
x
,
y
;
A
x
,
y
;
...
@@ -32,4 +31,3 @@ class Condition<A> implements Token {
...
@@ -32,4 +31,3 @@ class Condition<A> implements Token {
}
}
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/ConditionAndOr.java
浏览文件 @
4a053407
...
@@ -9,7 +9,6 @@ package org.h2.jaqu;
...
@@ -9,7 +9,6 @@ package org.h2.jaqu;
/**
/**
* An OR or an AND condition.
* An OR or an AND condition.
*/
*/
//## Java 1.5 begin ##
enum
ConditionAndOr
implements
Token
{
enum
ConditionAndOr
implements
Token
{
AND
(
"AND"
),
AND
(
"AND"
),
OR
(
"OR"
);
OR
(
"OR"
);
...
@@ -25,4 +24,3 @@ enum ConditionAndOr implements Token {
...
@@ -25,4 +24,3 @@ enum ConditionAndOr implements Token {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/Db.java
浏览文件 @
4a053407
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
...
@@ -25,7 +24,6 @@ import org.h2.jaqu.SQLDialect.DefaultSQLDialect;
...
@@ -25,7 +24,6 @@ import org.h2.jaqu.SQLDialect.DefaultSQLDialect;
import
org.h2.jaqu.Table.JQDatabase
;
import
org.h2.jaqu.Table.JQDatabase
;
import
org.h2.jaqu.Table.JQTable
;
import
org.h2.jaqu.Table.JQTable
;
import
org.h2.jaqu.util.WeakIdentityHashMap
;
import
org.h2.jaqu.util.WeakIdentityHashMap
;
//## Java 1.5 end ##
import
org.h2.util.JdbcUtils
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.New
;
import
org.h2.util.New
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
...
@@ -33,7 +31,6 @@ import org.h2.util.StringUtils;
...
@@ -33,7 +31,6 @@ import org.h2.util.StringUtils;
/**
/**
* This class represents a connection to a database.
* This class represents a connection to a database.
*/
*/
//## Java 1.5 begin ##
public
class
Db
{
public
class
Db
{
/**
/**
...
@@ -349,4 +346,3 @@ public class Db {
...
@@ -349,4 +346,3 @@ public class Db {
// }
// }
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/Define.java
浏览文件 @
4a053407
...
@@ -12,7 +12,6 @@ import org.h2.jaqu.Table.IndexType;
...
@@ -12,7 +12,6 @@ import org.h2.jaqu.Table.IndexType;
* This class provides utility methods to define primary keys, indexes, and set
* This class provides utility methods to define primary keys, indexes, and set
* the name of the table.
* the name of the table.
*/
*/
//## Java 1.5 begin ##
public
class
Define
{
public
class
Define
{
private
static
TableDefinition
<?>
currentTableDefinition
;
private
static
TableDefinition
<?>
currentTableDefinition
;
...
@@ -70,4 +69,3 @@ public class Define {
...
@@ -70,4 +69,3 @@ public class Define {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/Function.java
浏览文件 @
4a053407
...
@@ -6,15 +6,12 @@
...
@@ -6,15 +6,12 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
org.h2.jaqu.util.ClassUtils
;
import
org.h2.jaqu.util.ClassUtils
;
//## Java 1.5 end ##
/**
/**
* This class provides static methods that represents common SQL functions.
* This class provides static methods that represents common SQL functions.
*/
*/
public
class
Function
implements
Token
{
public
class
Function
implements
Token
{
//## Java 1.5 begin ##
// must be a new instance
// must be a new instance
private
static
final
Long
COUNT_STAR
=
Long
.
valueOf
(
0
);
private
static
final
Long
COUNT_STAR
=
Long
.
valueOf
(
0
);
...
@@ -148,5 +145,4 @@ public class Function implements Token {
...
@@ -148,5 +145,4 @@ public class Function implements Token {
});
});
}
}
//## Java 1.5 end ##
}
}
h2/src/tools/org/h2/jaqu/OrderExpression.java
浏览文件 @
4a053407
...
@@ -11,7 +11,6 @@ package org.h2.jaqu;
...
@@ -11,7 +11,6 @@ package org.h2.jaqu;
*
*
* @param <T> the query data type
* @param <T> the query data type
*/
*/
//## Java 1.5 begin ##
class
OrderExpression
<
T
>
{
class
OrderExpression
<
T
>
{
private
Query
<
T
>
query
;
private
Query
<
T
>
query
;
private
Object
expression
;
private
Object
expression
;
...
@@ -42,4 +41,3 @@ class OrderExpression<T> {
...
@@ -42,4 +41,3 @@ class OrderExpression<T> {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/Query.java
浏览文件 @
4a053407
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.sql.Clob
;
import
java.sql.Clob
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
...
@@ -19,7 +18,6 @@ import java.util.List;
...
@@ -19,7 +18,6 @@ import java.util.List;
import
org.h2.jaqu.bytecode.ClassReader
;
import
org.h2.jaqu.bytecode.ClassReader
;
import
org.h2.jaqu.util.StatementLogger
;
import
org.h2.jaqu.util.StatementLogger
;
import
org.h2.jaqu.util.ClassUtils
;
import
org.h2.jaqu.util.ClassUtils
;
//## Java 1.5 end ##
import
org.h2.util.JdbcUtils
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.New
;
import
org.h2.util.New
;
...
@@ -28,7 +26,6 @@ import org.h2.util.New;
...
@@ -28,7 +26,6 @@ import org.h2.util.New;
*
*
* @param <T> the return type
* @param <T> the return type
*/
*/
//## Java 1.5 begin ##
public
class
Query
<
T
>
{
public
class
Query
<
T
>
{
private
Db
db
;
private
Db
db
;
...
@@ -280,14 +277,12 @@ public class Query<T> {
...
@@ -280,14 +277,12 @@ public class Query<T> {
addConditionToken
(
token
);
addConditionToken
(
token
);
return
new
QueryWhere
<
T
>(
this
);
return
new
QueryWhere
<
T
>(
this
);
}
}
//## Java 1.5 end ##
/**
/**
* Sets the Limit and Offset of a query.
* Sets the Limit and Offset of a query.
*
*
* @return the query
* @return the query
*/
*/
//## Java 1.5 begin ##
public
Query
<
T
>
limit
(
long
limit
)
{
public
Query
<
T
>
limit
(
long
limit
)
{
this
.
limit
=
limit
;
this
.
limit
=
limit
;
return
this
;
return
this
;
...
@@ -297,7 +292,6 @@ public class Query<T> {
...
@@ -297,7 +292,6 @@ public class Query<T> {
this
.
offset
=
offset
;
this
.
offset
=
offset
;
return
this
;
return
this
;
}
}
//## Java 1.5 end ##
/**
/**
* Order by a number of columns.
* Order by a number of columns.
...
@@ -305,7 +299,6 @@ public class Query<T> {
...
@@ -305,7 +299,6 @@ public class Query<T> {
* @param expressions the columns
* @param expressions the columns
* @return the query
* @return the query
*/
*/
//## Java 1.5 begin ##
public
Query
<
T
>
orderBy
(
Object
...
expressions
)
{
public
Query
<
T
>
orderBy
(
Object
...
expressions
)
{
for
(
Object
expr
:
expressions
)
{
for
(
Object
expr
:
expressions
)
{
OrderExpression
<
T
>
e
=
OrderExpression
<
T
>
e
=
...
@@ -408,7 +401,6 @@ public class Query<T> {
...
@@ -408,7 +401,6 @@ public class Query<T> {
}
}
StatementLogger
.
select
(
stat
.
getSQL
());
StatementLogger
.
select
(
stat
.
getSQL
());
}
}
//## Java 1.5 end ##
/**
/**
* Join another table.
* Join another table.
...
@@ -416,7 +408,6 @@ public class Query<T> {
...
@@ -416,7 +408,6 @@ public class Query<T> {
* @param alias an alias for the table to join
* @param alias an alias for the table to join
* @return the joined query
* @return the joined query
*/
*/
//## Java 1.5 begin ##
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
<
U
>
QueryJoin
innerJoin
(
U
alias
)
{
public
<
U
>
QueryJoin
innerJoin
(
U
alias
)
{
TableDefinition
<
T
>
def
=
(
TableDefinition
<
T
>)
db
.
define
(
alias
.
getClass
());
TableDefinition
<
T
>
def
=
(
TableDefinition
<
T
>)
db
.
define
(
alias
.
getClass
());
...
@@ -443,4 +434,3 @@ public class Query<T> {
...
@@ -443,4 +434,3 @@ public class Query<T> {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/QueryCondition.java
浏览文件 @
4a053407
...
@@ -12,7 +12,6 @@ package org.h2.jaqu;
...
@@ -12,7 +12,6 @@ package org.h2.jaqu;
* @param <T> the return type of the query
* @param <T> the return type of the query
* @param <A> the incomplete condition data type
* @param <A> the incomplete condition data type
*/
*/
//## Java 1.5 begin ##
public
class
QueryCondition
<
T
,
A
>
{
public
class
QueryCondition
<
T
,
A
>
{
private
Query
<
T
>
query
;
private
Query
<
T
>
query
;
...
@@ -60,4 +59,3 @@ public class QueryCondition<T, A> {
...
@@ -60,4 +59,3 @@ public class QueryCondition<T, A> {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/QueryJoin.java
浏览文件 @
4a053407
...
@@ -9,7 +9,6 @@ package org.h2.jaqu;
...
@@ -9,7 +9,6 @@ package org.h2.jaqu;
/**
/**
* This class represents a query with a join.
* This class represents a query with a join.
*/
*/
//## Java 1.5 begin ##
public
class
QueryJoin
{
public
class
QueryJoin
{
private
Query
<?>
query
;
private
Query
<?>
query
;
...
@@ -24,4 +23,3 @@ public class QueryJoin {
...
@@ -24,4 +23,3 @@ public class QueryJoin {
return
new
QueryJoinCondition
<
A
>(
query
,
join
,
x
);
return
new
QueryJoinCondition
<
A
>(
query
,
join
,
x
);
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/QueryJoinCondition.java
浏览文件 @
4a053407
...
@@ -11,7 +11,6 @@ package org.h2.jaqu;
...
@@ -11,7 +11,6 @@ package org.h2.jaqu;
*
*
* @param <A> the incomplete condition data type
* @param <A> the incomplete condition data type
*/
*/
//## Java 1.5 begin ##
public
class
QueryJoinCondition
<
A
>
{
public
class
QueryJoinCondition
<
A
>
{
private
Query
<?>
query
;
private
Query
<?>
query
;
...
@@ -29,4 +28,3 @@ public class QueryJoinCondition<A> {
...
@@ -29,4 +28,3 @@ public class QueryJoinCondition<A> {
return
query
;
return
query
;
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/QueryWhere.java
浏览文件 @
4a053407
...
@@ -6,16 +6,13 @@
...
@@ -6,16 +6,13 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
java.util.List
;
import
java.util.List
;
//## Java 1.5 end ##
/**
/**
* This class represents a query with a condition.
* This class represents a query with a condition.
*
*
* @param <T> the return type
* @param <T> the return type
*/
*/
//## Java 1.5 begin ##
public
class
QueryWhere
<
T
>
{
public
class
QueryWhere
<
T
>
{
Query
<
T
>
query
;
Query
<
T
>
query
;
...
@@ -77,7 +74,6 @@ public class QueryWhere<T> {
...
@@ -77,7 +74,6 @@ public class QueryWhere<T> {
return
query
.
selectDistinct
();
return
query
.
selectDistinct
();
}
}
//## Java 1.5 end ##
/**
/**
* Order by a number of columns.
* Order by a number of columns.
...
@@ -85,7 +81,6 @@ public class QueryWhere<T> {
...
@@ -85,7 +81,6 @@ public class QueryWhere<T> {
* @param expressions the order by expressions
* @param expressions the order by expressions
* @return the query
* @return the query
*/
*/
//## Java 1.5 begin ##
public
QueryWhere
<
T
>
orderBy
(
Object
...
expressions
)
{
public
QueryWhere
<
T
>
orderBy
(
Object
...
expressions
)
{
for
(
Object
expr
:
expressions
)
{
for
(
Object
expr
:
expressions
)
{
OrderExpression
<
T
>
e
=
OrderExpression
<
T
>
e
=
...
@@ -143,4 +138,3 @@ public class QueryWhere<T> {
...
@@ -143,4 +138,3 @@ public class QueryWhere<T> {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/SQLStatement.java
浏览文件 @
4a053407
...
@@ -6,18 +6,15 @@
...
@@ -6,18 +6,15 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
//## Java 1.5 end ##
import
org.h2.util.JdbcUtils
;
import
org.h2.util.JdbcUtils
;
/**
/**
* This class represents a parameterized SQL statement.
* This class represents a parameterized SQL statement.
*/
*/
//## Java 1.5 begin ##
public
class
SQLStatement
{
public
class
SQLStatement
{
private
Db
db
;
private
Db
db
;
private
StringBuilder
buff
=
new
StringBuilder
();
private
StringBuilder
buff
=
new
StringBuilder
();
...
@@ -112,4 +109,3 @@ public class SQLStatement {
...
@@ -112,4 +109,3 @@ public class SQLStatement {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/SelectColumn.java
浏览文件 @
4a053407
...
@@ -6,16 +6,13 @@
...
@@ -6,16 +6,13 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
org.h2.jaqu.TableDefinition.FieldDefinition
;
import
org.h2.jaqu.TableDefinition.FieldDefinition
;
//## Java 1.5 end ##
/**
/**
* This class represents a column of a table in a query.
* This class represents a column of a table in a query.
*
*
* @param <T> the table data type
* @param <T> the table data type
*/
*/
//## Java 1.5 begin ##
class
SelectColumn
<
T
>
{
class
SelectColumn
<
T
>
{
private
SelectTable
<
T
>
selectTable
;
private
SelectTable
<
T
>
selectTable
;
private
FieldDefinition
fieldDef
;
private
FieldDefinition
fieldDef
;
...
@@ -45,4 +42,3 @@ class SelectColumn<T> {
...
@@ -45,4 +42,3 @@ class SelectColumn<T> {
return
fieldDef
.
getValue
(
selectTable
.
getCurrent
());
return
fieldDef
.
getValue
(
selectTable
.
getCurrent
());
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/SelectTable.java
浏览文件 @
4a053407
...
@@ -6,18 +6,15 @@
...
@@ -6,18 +6,15 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
org.h2.jaqu.util.ClassUtils
;
import
org.h2.jaqu.util.ClassUtils
;
import
org.h2.util.New
;
import
org.h2.util.New
;
//## Java 1.5 end ##
/**
/**
* This class represents a table in a query.
* This class represents a table in a query.
*
*
* @param <T> the table class
* @param <T> the table class
*/
*/
//## Java 1.5 begin ##
class
SelectTable
<
T
>
{
class
SelectTable
<
T
>
{
private
static
int
asCounter
;
private
static
int
asCounter
;
...
@@ -101,4 +98,3 @@ class SelectTable <T> {
...
@@ -101,4 +98,3 @@ class SelectTable <T> {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/TableDefinition.java
浏览文件 @
4a053407
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
package
org
.
h2
.
jaqu
;
package
org
.
h2
.
jaqu
;
//## Java 1.5 begin ##
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.lang.reflect.Modifier
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
...
@@ -23,7 +22,6 @@ import org.h2.jaqu.Table.JQSchema;
...
@@ -23,7 +22,6 @@ import org.h2.jaqu.Table.JQSchema;
import
org.h2.jaqu.Table.JQTable
;
import
org.h2.jaqu.Table.JQTable
;
import
org.h2.jaqu.util.StatementLogger
;
import
org.h2.jaqu.util.StatementLogger
;
import
org.h2.jaqu.util.ClassUtils
;
import
org.h2.jaqu.util.ClassUtils
;
//## Java 1.5 end ##
import
org.h2.util.New
;
import
org.h2.util.New
;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
...
@@ -34,26 +32,21 @@ import org.h2.util.StringUtils;
...
@@ -34,26 +32,21 @@ import org.h2.util.StringUtils;
*
*
* @param <T> the table type
* @param <T> the table type
*/
*/
//## Java 1.5 begin ##
class
TableDefinition
<
T
>
{
class
TableDefinition
<
T
>
{
//## Java 1.5 end ##
/**
/**
* The meta data of an index.
* The meta data of an index.
*/
*/
//## Java 1.5 begin ##
static
class
IndexDefinition
{
static
class
IndexDefinition
{
IndexType
type
;
IndexType
type
;
String
indexName
;
String
indexName
;
List
<
String
>
columnNames
;
List
<
String
>
columnNames
;
}
}
//## Java 1.5 end ##
/**
/**
* The meta data of a field.
* The meta data of a field.
*/
*/
//## Java 1.5 begin ##
static
class
FieldDefinition
{
static
class
FieldDefinition
{
String
columnName
;
String
columnName
;
Field
field
;
Field
field
;
...
@@ -644,4 +637,3 @@ class TableDefinition<T> {
...
@@ -644,4 +637,3 @@ class TableDefinition<T> {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/TestCondition.java
浏览文件 @
4a053407
...
@@ -13,7 +13,6 @@ import org.h2.jaqu.util.ClassUtils;
...
@@ -13,7 +13,6 @@ import org.h2.jaqu.util.ClassUtils;
*
*
* @param <A> the incomplete condition data type
* @param <A> the incomplete condition data type
*/
*/
//## Java 1.5 begin ##
public
class
TestCondition
<
A
>
{
public
class
TestCondition
<
A
>
{
private
A
x
;
private
A
x
;
...
@@ -101,4 +100,3 @@ public class TestCondition<A> {
...
@@ -101,4 +100,3 @@ public class TestCondition<A> {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/Token.java
浏览文件 @
4a053407
...
@@ -16,7 +16,5 @@ public interface Token {
...
@@ -16,7 +16,5 @@ public interface Token {
* @param stat the statement to append the SQL to
* @param stat the statement to append the SQL to
* @param query the query to use
* @param query the query to use
*/
*/
//## Java 1.5 begin ##
<
T
>
void
appendSQL
(
SQLStatement
stat
,
Query
<
T
>
query
);
<
T
>
void
appendSQL
(
SQLStatement
stat
,
Query
<
T
>
query
);
//## Java 1.5 end ##
}
}
h2/src/tools/org/h2/jaqu/UpdateColumn.java
浏览文件 @
4a053407
...
@@ -17,8 +17,6 @@ public interface UpdateColumn {
...
@@ -17,8 +17,6 @@ public interface UpdateColumn {
*
*
* @param stat the statement to append the SQL to
* @param stat the statement to append the SQL to
*/
*/
//## Java 1.5 begin ##
void
appendSQL
(
SQLStatement
stat
);
void
appendSQL
(
SQLStatement
stat
);
//## Java 1.5 end ##
}
}
h2/src/tools/org/h2/jaqu/UpdateColumnIncrement.java
浏览文件 @
4a053407
...
@@ -12,7 +12,6 @@ package org.h2.jaqu;
...
@@ -12,7 +12,6 @@ package org.h2.jaqu;
* @param <T> the query type
* @param <T> the query type
* @param <A> the new value data type
* @param <A> the new value data type
*/
*/
//## Java 1.5 begin ##
public
class
UpdateColumnIncrement
<
T
,
A
>
implements
UpdateColumn
{
public
class
UpdateColumnIncrement
<
T
,
A
>
implements
UpdateColumn
{
private
Query
<
T
>
query
;
private
Query
<
T
>
query
;
...
@@ -40,4 +39,3 @@ public class UpdateColumnIncrement<T, A> implements UpdateColumn {
...
@@ -40,4 +39,3 @@ public class UpdateColumnIncrement<T, A> implements UpdateColumn {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/UpdateColumnSet.java
浏览文件 @
4a053407
...
@@ -12,7 +12,6 @@ package org.h2.jaqu;
...
@@ -12,7 +12,6 @@ package org.h2.jaqu;
* @param <T> the query type
* @param <T> the query type
* @param <A> the new value data type
* @param <A> the new value data type
*/
*/
//## Java 1.5 begin ##
public
class
UpdateColumnSet
<
T
,
A
>
implements
UpdateColumn
{
public
class
UpdateColumnSet
<
T
,
A
>
implements
UpdateColumn
{
private
Query
<
T
>
query
;
private
Query
<
T
>
query
;
...
@@ -37,4 +36,3 @@ public class UpdateColumnSet<T, A> implements UpdateColumn {
...
@@ -37,4 +36,3 @@ public class UpdateColumnSet<T, A> implements UpdateColumn {
}
}
}
}
//## Java 1.5 end ##
h2/src/tools/org/h2/jaqu/util/ClassUtils.java
浏览文件 @
4a053407
...
@@ -6,63 +6,26 @@
...
@@ -6,63 +6,26 @@
*/
*/
package
org
.
h2
.
jaqu
.
util
;
package
org
.
h2
.
jaqu
.
util
;
//## Java 1.5 begin ##
import
java.io.IOException
;
import
java.io.Reader
;
import
java.io.Reader
;
import
java.io.StringWriter
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Constructor
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.sql.Clob
;
import
java.sql.Clob
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.IdentityHashMap
;
import
java.util.IdentityHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.concurrent.atomic.AtomicLong
;
import
org.h2.util.IOUtils
;
import
org.h2.util.IOUtils
;
//## Java 1.5 end ##
/**
/**
* Generic utility methods.
* Generic utility methods.
*/
*/
public
class
ClassUtils
{
public
class
ClassUtils
{
//## Java 1.5 begin ##
private
static
final
AtomicLong
COUNTER
=
new
AtomicLong
(
0
);
private
static
final
AtomicLong
COUNTER
=
new
AtomicLong
(
0
);
private
static
final
boolean
MAKE_ACCESSIBLE
=
true
;
private
static
final
boolean
MAKE_ACCESSIBLE
=
true
;
private
static
final
int
BUFFER_BLOCK_SIZE
=
4
*
1024
;
// public static <T> ArrayList<T> newArrayList() {
// return new ArrayList<T>();
// }
//
// public static <T> ArrayList<T> newArrayList(Collection<T> c) {
// return new ArrayList<T>(c);
// }
//
// public static <T> HashSet<T> newHashSet() {
// return new HashSet<T>();
// }
// public static <T> HashSet<T> newHashSet(Collection<T> list) {
// return new HashSet<T>(list);
// }
//
// public static <A, B> HashMap<A, B> newHashMap() {
// return new HashMap<A, B>();
// }
//
// public static <A, B> Map<A, B> newSynchronizedHashMap() {
// HashMap<A, B> map = newHashMap();
// return Collections.synchronizedMap(map);
// }
public
static
<
A
,
B
>
IdentityHashMap
<
A
,
B
>
newIdentityHashMap
()
{
public
static
<
A
,
B
>
IdentityHashMap
<
A
,
B
>
newIdentityHashMap
()
{
return
new
IdentityHashMap
<
A
,
B
>();
return
new
IdentityHashMap
<
A
,
B
>();
}
}
...
@@ -188,5 +151,4 @@ public class ClassUtils {
...
@@ -188,5 +151,4 @@ public class ClassUtils {
return
(
Class
<
X
>)
x
.
getClass
();
return
(
Class
<
X
>)
x
.
getClass
();
}
}
//## Java 1.5 end ##
}
}
h2/src/tools/org/h2/jaqu/util/WeakIdentityHashMap.java
浏览文件 @
4a053407
...
@@ -6,12 +6,10 @@
...
@@ -6,12 +6,10 @@
*/
*/
package
org
.
h2
.
jaqu
.
util
;
package
org
.
h2
.
jaqu
.
util
;
//## Java 1.5 begin ##
import
java.lang.ref.WeakReference
;
import
java.lang.ref.WeakReference
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
//## Java 1.5 end ##
/**
/**
* This hash map uses weak references, so that elements that are no longer
* This hash map uses weak references, so that elements that are no longer
...
@@ -22,7 +20,6 @@ import java.util.Set;
...
@@ -22,7 +20,6 @@ import java.util.Set;
* @param <K> the keys
* @param <K> the keys
* @param <V> the value
* @param <V> the value
*/
*/
//## Java 1.5 begin ##
public
class
WeakIdentityHashMap
<
K
,
V
>
implements
Map
<
K
,
V
>
{
public
class
WeakIdentityHashMap
<
K
,
V
>
implements
Map
<
K
,
V
>
{
private
static
final
int
MAX_LOAD
=
90
;
private
static
final
int
MAX_LOAD
=
90
;
...
@@ -229,4 +226,3 @@ public class WeakIdentityHashMap<K, V> implements Map<K, V> {
...
@@ -229,4 +226,3 @@ public class WeakIdentityHashMap<K, V> implements Map<K, V> {
}
}
}
}
//## Java 1.5 end ##
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论