Skip to content

Commit 2d698f4

Browse files
committed
Update QueryBuilder and ResultSetAdapter.
1 parent 84d5472 commit 2d698f4

4 files changed

Lines changed: 22 additions & 2 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
subprojects {
1616
group = 'org.httprpc'
17-
version = '5.3.5'
17+
version = '5.3.6'
1818

1919
repositories {
2020
mavenCentral()

kilo-client/src/main/java/org/httprpc/kilo/sql/QueryBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ private static Function<Object, Object> getReadTransform(Method accessor) {
412412
*
413413
* @return
414414
* The {@link QueryBuilder} instance.
415+
*
416+
* @deprecated
417+
* Use {@link #join(Class, Class)} instead.
415418
*/
419+
@Deprecated
416420
public QueryBuilder join(Class<?> parentType) {
417421
return join(parentType, parentType);
418422
}

kilo-client/src/main/java/org/httprpc/kilo/sql/ResultSetAdapter.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,20 @@ public Map<String, Object> next() {
9595
}
9696
};
9797

98-
ResultSetAdapter(ResultSet resultSet, Map<String, Function<Object, Object>> transforms) {
98+
/**
99+
* Constructs a new result set adapter.
100+
*
101+
* @param resultSet
102+
* The result set.
103+
*
104+
* @param transforms
105+
* The transform map.
106+
*/
107+
public ResultSetAdapter(ResultSet resultSet, Map<String, Function<Object, Object>> transforms) {
108+
if (resultSet == null || transforms == null) {
109+
throw new IllegalArgumentException();
110+
}
111+
99112
this.resultSet = resultSet;
100113
this.transforms = transforms;
101114

kilo-client/src/test/java/org/httprpc/kilo/sql/QueryBuilderTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ public void testSelectDtoA() {
335335
}
336336

337337
@Test
338+
@SuppressWarnings("deprecation")
338339
public void testSelectIHGF() {
339340
var queryBuilder = QueryBuilder.select(I.class, H.class, G.class)
340341
.join(H.class)
@@ -403,6 +404,7 @@ public void testSelectDistinctIndex() {
403404
}
404405

405406
@Test
407+
@SuppressWarnings("deprecation")
406408
public void testInvalidJoin() {
407409
assertThrows(UnsupportedOperationException.class, () -> QueryBuilder.select(A.class).join(String.class));
408410
assertThrows(UnsupportedOperationException.class, () -> QueryBuilder.select(A.class).join(String.class));
@@ -538,6 +540,7 @@ public void testDelete() {
538540
}
539541

540542
@Test
543+
@SuppressWarnings("deprecation")
541544
public void testAppendLine() {
542545
var queryBuilder = new QueryBuilder();
543546

0 commit comments

Comments
 (0)