T - Type of itemspublic final class ListOutcome<T> extends Object implements Outcome<List<T>>
Use it when you need a full collection:
Collection&lgt;User> users = new JdbcSession(source)
.sql("SELECT * FROM user")
.select(
new ListOutcome<User>(
new ListOutcome.Mapping<User>() {
@Override
public User map(final ResultSet rset) throws SQLException {
return new User.Simple(rset.getLong(1), rset.getString(2));
}
}
)
);| Modifier and Type | Class and Description |
|---|---|
static interface |
ListOutcome.Mapping<T>
Mapping.
|
LAST_INSERT_ID, NOT_EMPTY, UPDATE_COUNT, VOID| Constructor and Description |
|---|
ListOutcome(ListOutcome.Mapping<T> mpg)
Public ctor.
|
| Modifier and Type | Method and Description |
|---|---|
List<T> |
handle(ResultSet rset,
Statement stmt)
Process the result set and return some value.
|
public ListOutcome(ListOutcome.Mapping<T> mpg)
mpg - Mappingpublic List<T> handle(ResultSet rset, Statement stmt) throws SQLException
Outcomehandle in interface Outcome<List<T>>rset - The result set to processstmt - The statement used in the runSQLException - If something goes wrong insideCopyright © 2012–2019 jcabi.com. All rights reserved.