Skip to content

Commit 50c9259

Browse files
committed
give non-constructor-based resultType examples
1 parent 6b8ab57 commit 50c9259

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mug-guava/src/main/java/com/google/mu/safesql/SafeSql.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
* WHERE firstName = {first_name} AND lastName IN ({last_names})
8989
* """,
9090
* firstName, lastNamesList);
91-
* List<Long> ids = sql.query(connection, row -> row.getLong("id"));
91+
* List<Long> ids = sql.query(connection, Long.class);
9292
* }</pre>
9393
*
9494
* In the above example if {@code firstName} is "Emma" and {@code lastNamesList} is
@@ -262,7 +262,7 @@
262262
* String searchTerm = ...;
263263
* SafeSql sql = SafeSql.of(
264264
* "SELECT id FROM Users WHERE firstName LIKE '%{search_term}%'", searchTerm);
265-
* List<Long> ids = sql.query(connection, row -> row.getLong("id"));
265+
* List<Long> ids = sql.query(connection, Long.class);
266266
* }</pre>
267267
*
268268
* <p><strong>Automatic Escaping: No Need for ESCAPE Clause</strong></p>
@@ -371,7 +371,7 @@ private SafeSql(String sql, List<?> paramValues) {
371371
* List<Long> jobIds = SafeSql.of(
372372
* "SELECT id FROM Jobs WHERE timestamp BETWEEN {start} AND {end}",
373373
* startTime, endTime)
374-
* .query(connection, row -> row.getLong("id"));
374+
* .query(connection, Long.class);
375375
* }</pre>
376376
*
377377
* <p>Note that if you plan to create a {@link PreparedStatement} and use it multiple times

0 commit comments

Comments
 (0)