提交 2cec352c authored 作者: Thomas Mueller's avatar Thomas Mueller

switch to JDK 1.6

上级 3ca78807
......@@ -6,7 +6,7 @@
*/
package org.h2.test.jaqu;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import static org.h2.jaqu.Define.*;
import java.math.BigDecimal;
......@@ -15,12 +15,12 @@ import java.util.Date;
import java.util.List;
import org.h2.jaqu.Table;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* A table containing order data.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class Order implements Table {
public String customerId;
......@@ -59,4 +59,4 @@ public class Order implements Table {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -6,7 +6,7 @@
*/
package org.h2.test.jaqu;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.util.Arrays;
import java.util.List;
......@@ -17,7 +17,7 @@ import static org.h2.jaqu.Define.*;
/**
* A table containing product data.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class Product implements Table {
public Integer productId;
......@@ -134,5 +134,5 @@ public class Product implements Table {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -6,19 +6,19 @@
*/
package org.h2.test.jaqu;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.math.BigDecimal;
import java.util.List;
import org.h2.jaqu.Db;
import org.h2.test.TestBase;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* Implementation of the 101 LINQ Samples as described in
* http://msdn2.microsoft.com/en-us/vcsharp/aa336760.aspx
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class SamplesTest extends TestBase {
private Db db;
......@@ -141,12 +141,12 @@ public class SamplesTest extends TestBase {
assertEquals(products.get(i).productName, productNames.get(i));
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* A result set class containing the product name and price.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public static class ProductPrice {
public String productName;
public String category;
......@@ -182,12 +182,12 @@ public class SamplesTest extends TestBase {
assertEquals(p2.unitPrice, pr.price);
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* A result set class containing customer data and the order total.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public static class CustOrder {
public String customerId;
public Integer orderId;
......@@ -233,4 +233,4 @@ public class SamplesTest extends TestBase {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -9,7 +9,7 @@ package org.h2.jaqu;
/**
* A enumeration of compare operations.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public enum CompareType {
EQUAL("=", true),
BIGGER(">", true),
......@@ -38,5 +38,5 @@ public enum CompareType {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -11,7 +11,7 @@ package org.h2.jaqu;
*
* @param <A> the operand type
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class Condition<A> implements ConditionToken {
Query< ? > query;
CompareType compareType;
......@@ -31,4 +31,4 @@ public class Condition<A> implements ConditionToken {
return query.getString(x) + compareType.toString();
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -9,7 +9,7 @@ package org.h2.jaqu;
/**
* An OR or an AND condition.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public enum ConditionAndOr implements ConditionToken {
AND("AND"),
OR("OR");
......@@ -25,4 +25,4 @@ public enum ConditionAndOr implements ConditionToken {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -6,7 +6,7 @@
*/
package org.h2.jaqu;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
......@@ -19,12 +19,12 @@ import org.h2.jaqu.TableDefinition.FieldDefinition;
import org.h2.jaqu.util.Utils;
import org.h2.jaqu.util.WeakIdentityHashMap;
import org.h2.util.JdbcUtils;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* This class represents a connection to a database.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class Db {
private final Connection conn;
......@@ -151,4 +151,4 @@ public class Db {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -10,7 +10,7 @@ package org.h2.jaqu;
* This class provides utility methods to define primary keys, indexes, and set
* the name of the table.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class Define {
private static TableDefinition currentTableDefinition;
......@@ -48,4 +48,4 @@ public class Define {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -6,7 +6,7 @@
*/
package org.h2.jaqu;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
......@@ -14,14 +14,14 @@ import java.util.List;
import org.h2.jaqu.TableDefinition.FieldDefinition;
import org.h2.jaqu.util.Utils;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* This class represents a query.
*
* @param <T> the return type
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class Query<T> {
private Db db;
......@@ -108,7 +108,7 @@ public class Query<T> {
public <A> QueryCondition<T, A> where(A x) {
return new QueryCondition<T, A>(this, x);
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* Order by a number of columns.
......@@ -116,7 +116,7 @@ public class Query<T> {
* @param columns the columns
* @return the query
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public Query<T> orderBy(Integer... columns) {
return this;
}
......@@ -145,7 +145,7 @@ public class Query<T> {
}
return buff.toString();
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* Join another table.
......@@ -153,10 +153,10 @@ public class Query<T> {
* @param u an alias for the table to join
* @return the joined query
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public QueryJoin innerJoin(Object u) {
return new QueryJoin(this);
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -12,7 +12,7 @@ package org.h2.jaqu;
* @param <T> the return type of the query
* @param <A> the incomplete condition data type
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class QueryCondition<T, A> {
private Query<T> query;
......@@ -39,4 +39,4 @@ public class QueryCondition<T, A> {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -9,7 +9,7 @@ package org.h2.jaqu;
/**
* This class represents a query with a join.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class QueryJoin {
Query< ? > query;
......@@ -22,4 +22,4 @@ public class QueryJoin {
return new QueryJoinCondition<A>(query, x);
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -11,7 +11,7 @@ package org.h2.jaqu;
*
* @param <A> the incomplete condition data type
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class QueryJoinCondition<A> {
private Query< ? > query;
......@@ -27,4 +27,4 @@ public class QueryJoinCondition<A> {
return query;
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -6,16 +6,16 @@
*/
package org.h2.jaqu;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.util.List;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* This class represents a query with a condition.
*
* @param <T> the return type
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class QueryWhere<T> {
Query<T> query;
......@@ -41,7 +41,7 @@ public class QueryWhere<T> {
public List<T> select() {
return query.select();
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* Order by a number of columns.
......@@ -49,10 +49,10 @@ public class QueryWhere<T> {
* @param columns the columns
* @return the query
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public QueryWhere<T> orderBy(Integer... columns) {
return this;
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -6,7 +6,7 @@
*/
package org.h2.jaqu;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.lang.reflect.Field;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
......@@ -16,7 +16,7 @@ import java.util.IdentityHashMap;
import java.util.Map;
import org.h2.jaqu.util.Utils;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* A table definition contains the index definitions of a table, the field
......@@ -24,25 +24,25 @@ import org.h2.jaqu.util.Utils;
*
* @param <T> the table type
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
class TableDefinition<T> {
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* The meta data of an index.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
static class IndexDefinition {
boolean unique;
String indexName;
String[] columnNames;
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* The meta data of a field.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
static class FieldDefinition<X> {
String columnName;
Field field;
......@@ -238,4 +238,4 @@ class TableDefinition<T> {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -17,7 +17,7 @@ public class ClassUtils {
// utility class
}
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public static Class< ? > loadClass(String className) {
try {
return Class.forName(className);
......@@ -25,5 +25,5 @@ public class ClassUtils {
throw new RuntimeException(e);
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
}
......@@ -6,11 +6,11 @@
*/
package org.h2.jaqu.util;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* Messages used in the database engine.
......@@ -30,7 +30,7 @@ public class Message {
* @param e the root cause
* @return the SQL exception object
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public static SQLException convert(Throwable e) {
if (e instanceof SQLException) {
return (SQLException) e;
......@@ -46,6 +46,6 @@ public class Message {
}
return new SQLException("General exception: " + e.toString(), e);
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
}
......@@ -6,7 +6,7 @@
*/
package org.h2.jaqu.util;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.lang.reflect.Constructor;
import java.math.BigDecimal;
import java.math.BigInteger;
......@@ -18,12 +18,12 @@ import java.util.List;
import java.util.Map;
import org.h2.util.StringUtils;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* Generic utility methods.
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class Utils {
private static volatile long counter;
......@@ -129,4 +129,4 @@ public class Utils {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
......@@ -6,12 +6,12 @@
*/
package org.h2.jaqu.util;
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
import java.lang.ref.WeakReference;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
## Java 1.6 end ##*/
//## Java 1.6 end ##
/**
* This hash map uses weak references, so that elements that are no longer
......@@ -21,7 +21,7 @@ import java.util.Set;
* @param <K> the keys
* @param <V> the value
*/
/*## Java 1.6 begin ##
//## Java 1.6 begin ##
public class WeakIdentityHashMap<K, V> implements Map<K, V> {
private static final int MAX_LOAD = 90;
private static final WeakReference DELETED_KEY = new WeakReference(null);
......@@ -224,4 +224,4 @@ public class WeakIdentityHashMap<K, V> implements Map<K, V> {
}
}
## Java 1.6 end ##*/
//## Java 1.6 end ##
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论