This commit is contained in:
Looly
2023-03-13 01:11:43 +08:00
parent f05e084a3b
commit 5b559d19bd
94 changed files with 320 additions and 309 deletions

View File

@@ -151,17 +151,16 @@ public class ResultColumn {
return className;
}
public static enum ColumnNullable {
public enum ColumnNullable {
NO_NULLS(ResultSetMetaData.columnNoNulls),
NULLABLE(ResultSetMetaData.columnNullable),
UNKNOWN(ResultSetMetaData.columnNullableUnknown);
final int value;
private ColumnNullable(final int value) {
this.value = value;
}
/**
* ResultSetMetaData中的int值转枚举
* @param nullable nullable值
* @return ColumnNullable
*/
public static ColumnNullable of(final int nullable) {
switch (nullable) {
case ResultSetMetaData.columnNoNulls:
@@ -172,5 +171,10 @@ public class ResultColumn {
return UNKNOWN;
}
}
final int value;
ColumnNullable(final int value) {
this.value = value;
}
}
}

View File

@@ -13,6 +13,7 @@ import java.util.List;
* @since 5.7.21
*/
public class ConditionGroup extends Condition {
private static final long serialVersionUID = 1L;
/**
* 条件列表
*/

View File

@@ -5,7 +5,6 @@ import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import java.sql.SQLException;
import java.util.List;
/**
@@ -19,7 +18,7 @@ public class DerbyTest {
private static final String DS_GROUP_NAME = "derby";
@BeforeClass
public static void init() throws SQLException {
public static void init() {
final Db db = Db.of(DS_GROUP_NAME);
db.execute("CREATE TABLE test(a INTEGER, b BIGINT)");
@@ -31,14 +30,14 @@ public class DerbyTest {
@Test
@Ignore
public void queryTest() throws SQLException {
public void queryTest() {
final List<Entity> query = Db.of(DS_GROUP_NAME).query("select * from test");
Assert.assertEquals(4, query.size());
}
@Test
@Ignore
public void findTest() throws SQLException {
public void findTest() {
final List<Entity> query = Db.of(DS_GROUP_NAME).find(Entity.of("test"));
Assert.assertEquals(4, query.size());
}