提交 fe741914 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 ff25a9ff
/*
* Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import static org.h2.jaqu.Define.*;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.sql.Time;
import java.sql.Timestamp;
import org.h2.jaqu.Table;
//## Java 1.5 end ##
/**
* A table containing all possible data types.
*/
//## Java 1.5 begin ##
public class ComplexObject implements Table {
Integer id;
Long amount;
String name;
BigDecimal value;
Date birthday;
Time time;
Timestamp created;
public void define() {
primaryKey(id);
}
public static List<ComplexObject> getList() {
ComplexObject[] list = new ComplexObject[] {
// new Order("ALFKI", 10702, "330.00", "2007-01-02"),
// new Order("ALFKI", 10952, "471.20", "2007-02-03"),
// new Order("ANATR", 10308, "88.80", "2007-01-03"),
// new Order("ANATR", 10625, "479.75", "2007-03-03"),
// new Order("ANATR", 10759, "320.00", "2007-04-01"),
// new Order("ANTON", 10365, "403.20", "2007-02-13"),
// new Order("ANTON", 10682, "375.50", "2007-03-13"),
// new Order("ANTON", 10355, "480.00", "2007-04-11")
};
return Arrays.asList(list);
}
}
//## Java 1.5 end ##
......@@ -49,6 +49,7 @@ public class SamplesTest extends TestBase {
db.insertAll(Product.getProductList());
db.insertAll(Customer.getCustomerList());
db.insertAll(Order.getOrderList());
db.insertAll(ComplexObject.getList());
// TODO use prepared statements
// TODO test all relevant data types (Date,...)
// TODO nested AND/OR, >, <,...
......
-- update all rows in all tables
select 'update ' || table_schema || '.' || table_name || ' set ' || column_name || '=' || column_name || ';'
from information_schema.columns where ORDINAL_POSITION = 1 and table_schema <> 'INFORMATION_SCHEMA';
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论