T
- Type of items@Immutable public 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.
|
public ListOutcome(ListOutcome.Mapping<T> mpg)
mpg
- Mapping@Loggable(value=1) public List<T> handle(ResultSet rset, Statement stmt) throws SQLException
Outcome
handle
in interface Outcome<List<T>>
rset
- The result set to processstmt
- The statement used in the runSQLException
- If something goes wrong insideCopyright © 2012–2015 jcabi.com. All rights reserved.