diff --git a/src/main/java/org/teasoft/bee/osql/chain/ToSql.java b/src/main/java/org/teasoft/bee/osql/chain/ToSql.java
index 8fdad2896182fa0f53dd2710f686b77fba8a40f8..ace7755ca3cfc4bdc3d2db3b36e5d53b15e54d56 100644
--- a/src/main/java/org/teasoft/bee/osql/chain/ToSql.java
+++ b/src/main/java/org/teasoft/bee/osql/chain/ToSql.java
@@ -22,6 +22,16 @@ package org.teasoft.bee.osql.chain;
* @since 1.3
*/
public interface ToSql {
+ /**
+ * 转成SQL语句. to SQL statement.
+ * @return sql语句.sql statement.
+ */
public String toSQL();
+
+ /**
+ * 转成SQL语句. to SQL statement.
+ * @param noSemicolon 不包含分号.no semicolon.
+ * @return sql语句.sql statement.
+ */
public String toSQL(boolean noSemicolon);
}
diff --git a/src/main/java/org/teasoft/bee/osql/transaction/TransactionIsolationLevel.java b/src/main/java/org/teasoft/bee/osql/transaction/TransactionIsolationLevel.java
index 26788248a08c09a306cd56c0b7f2853255ceb600..937c88ca4542878f48291825f356f49407524de0 100644
--- a/src/main/java/org/teasoft/bee/osql/transaction/TransactionIsolationLevel.java
+++ b/src/main/java/org/teasoft/bee/osql/transaction/TransactionIsolationLevel.java
@@ -24,11 +24,51 @@ package org.teasoft.bee.osql.transaction;
*/
public enum TransactionIsolationLevel
{
- TRANSACTION_NONE(0),
+ /**
+ * 指示事务不受支持的常量.A constant indicating that transactions are not supported.
+ */
+ TRANSACTION_NONE(0),
+ /**
+ * 指示可以发生:脏读 (dirty read)、不可重复读和虚读 (phantom read) 的常量
+ * A constant indicating that dirty reads, non-repeatable reads and phantom reads can occur.
+ * This level allows a row changed by one transaction to be read
+ * by another transaction before any changes in that row have been
+ * committed (a "dirty read"). If any of the changes are rolled back,
+ * the second transaction will have retrieved an invalid row.
+ */
TRANSACTION_READ_UNCOMMITTED(1),
+
+ /**
+ * 指示不可以发生脏读的常量;不可重复读和虚读可以发生
A constant indicating that
+ * dirty reads are prevented; non-repeatable reads and phantom reads can occur.
+ * This level only prohibits a transaction
+ * from reading a row with uncommitted changes in it.
+ */
TRANSACTION_READ_COMMITTED(2),
+ /**
+ * 指示不可以发生脏读和不可重复读的常量;虚读可以发生
+ * A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur.
+ * This level prohibits a transaction from
+ * reading a row with uncommitted changes in it, and it also
+ * prohibits the situation where one transaction reads a row,
+ * a second transaction alters the row, and the first transaction
+ * rereads the row, getting different values the second time
+ * (a "non-repeatable read").
+ */
TRANSACTION_REPEATABLE_READ(4),
+
+ /**
+ * 指示不可以发生脏读、不可重复读和虚读的常量
A constant indicating that
+ * dirty reads, non-repeatable reads and phantom reads are prevented.
+ * This level includes the prohibitions in
+ * TRANSACTION_REPEATABLE_READ and further prohibits the
+ * situation where one transaction reads all rows that satisfy
+ * a WHERE condition, a second transaction inserts a row that
+ * satisfies that WHERE condition, and the first transaction
+ * rereads for the same condition, retrieving the additional
+ * "phantom" row in the second read.
+ */
TRANSACTION_SERIALIZABLE(8);
private final int level;
@@ -37,6 +77,10 @@ public enum TransactionIsolationLevel
this.level = level;
}
+ /**
+ * 获取隔离级别.get the value of TransactionIsolationLevel.
+ * @return 隔离级别的值.value of TransactionIsolationLevel.
+ */
public int getLevel() {
return this.level;
}