Skip to content

Commit 6ebdced

Browse files
committed
Remove deprecated methods.
1 parent f1da6fe commit 6ebdced

File tree

2 files changed

+1
-84
lines changed

2 files changed

+1
-84
lines changed

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 = '7.0.3'
17+
version = '7.1'
1818

1919
apply plugin: 'java-library'
2020
apply plugin: 'maven-publish'

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

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@
1414

1515
package org.httprpc.sql;
1616

17-
import java.sql.Connection;
18-
import java.sql.PreparedStatement;
1917
import java.sql.ResultSet;
2018
import java.sql.ResultSetMetaData;
2119
import java.sql.SQLException;
2220
import java.util.Iterator;
2321
import java.util.LinkedHashMap;
24-
import java.util.LinkedList;
2522
import java.util.Map;
2623
import java.util.NoSuchElementException;
2724
import java.util.stream.Stream;
@@ -35,9 +32,6 @@ public class ResultSetAdapter implements Iterable<Map<String, Object>> {
3532
private ResultSet resultSet;
3633
private ResultSetMetaData resultSetMetaData;
3734

38-
// TODO Remove this when attach() method is dropped
39-
private LinkedHashMap<String, Parameters> subqueries = new LinkedHashMap<>();
40-
4135
private Iterator<Map<String, Object>> iterator = new Iterator<Map<String, Object>>() {
4236
private Boolean hasNext = null;
4337

@@ -92,30 +86,6 @@ public Map<String, Object> next() {
9286
throw new RuntimeException(exception);
9387
}
9488

95-
for (Map.Entry<String, Parameters> entry : subqueries.entrySet()) {
96-
LinkedList<Map<String, Object>> results = new LinkedList<>();
97-
98-
try {
99-
Connection connection = resultSet.getStatement().getConnection();
100-
101-
Parameters parameters = entry.getValue();
102-
103-
try (PreparedStatement statement = connection.prepareStatement(parameters.getSQL())) {
104-
parameters.apply(statement, row);
105-
106-
try (ResultSet resultSet = statement.executeQuery()) {
107-
for (Map<String, Object> result : new ResultSetAdapter(resultSet)) {
108-
results.add(result);
109-
}
110-
}
111-
}
112-
} catch (SQLException exception) {
113-
throw new RuntimeException(exception);
114-
}
115-
116-
row.put(entry.getKey(), results);
117-
}
118-
11989
hasNext = null;
12090

12191
return row;
@@ -142,59 +112,6 @@ public ResultSetAdapter(ResultSet resultSet) {
142112
}
143113
}
144114

145-
/**
146-
* Attaches a subquery to the result set.
147-
*
148-
* @param key
149-
* The key to associate with the subquery results.
150-
*
151-
* @param subquery
152-
* The subquery to attach.
153-
*
154-
* @deprecated Use {@link Stream} operations instead.
155-
*/
156-
@Deprecated
157-
public void attach(String key, String subquery) {
158-
attach(key, Parameters.parse(subquery));
159-
}
160-
161-
/**
162-
* Attaches a subquery to the result set.
163-
*
164-
* @param key
165-
* The key to associate with the subquery results.
166-
*
167-
* @param subquery
168-
* The subquery to attach.
169-
*
170-
* @deprecated Use {@link Stream} operations instead.
171-
*/
172-
@Deprecated
173-
public void attach(String key, Parameters subquery) {
174-
if (key == null) {
175-
throw new IllegalArgumentException();
176-
}
177-
178-
if (subquery == null) {
179-
throw new IllegalArgumentException();
180-
}
181-
182-
subqueries.put(key, subquery);
183-
}
184-
185-
/**
186-
* Returns the next result.
187-
*
188-
* @return
189-
* The next result, or <tt>null</tt> if there are no more results.
190-
*
191-
* @deprecated Use {@link Stream} operations instead.
192-
*/
193-
@Deprecated
194-
public Map<String, Object> next() {
195-
return iterator.hasNext() ? iterator.next() : null;
196-
}
197-
198115
@Override
199116
public Iterator<Map<String, Object>> iterator() {
200117
return iterator;

0 commit comments

Comments
 (0)