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

switch to JDK 1.6

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