Uses of Class
org.sql2o.Query
-
Uses of Query in org.sql2o
Modifier and TypeMethodDescriptionQuery.addColumnMapping
(String columnName, String propertyName) Query.addParameter
(String name, boolean value) Query.addParameter
(String name, int value) Query.addParameter
(String name, long value) Query.addParameter
(String name, InputStream value) Query.addParameter
(String name, Boolean value) <T> Query
Query.addParameter
(String name, Class<T> parameterClass, T value) Query.addParameter
(String name, Integer value) Query.addParameter
(String name, Long value) Query.addParameter
(String name, Object value) Query.addParameter
(String name, Object... values) Set an array parameter.
For example:Query.addParameter
(String name, String value) Query.addParameter
(String name, Time value) Query.addParameter
(String name, Timestamp value) Query.addParameter
(String name, Collection<?> values) Set an array parameter.
SeeaddParameter(String, Object...)
for detailsQuery.addParameter
(String name, UUID value) Query.addToBatch()
Adds a set of parameters to thisQuery
object's batch of commands.Connection.createQuery
(String queryText) Connection.createQuery
(String queryText, boolean returnGeneratedKeys) Connection.createQuery
(String queryText, String... columnNames) Sql2o.createQuery
(String query) Deprecated.Sql2o.createQuery
(String query, boolean returnGeneratedKeys) Deprecated.create queries withConnection
class instead, using try-with-resource blockstry (Connection con = sql2o.open()) { return sql2o.createQuery(query, name, returnGeneratedKeys).executeAndFetch(Pojo.class); }
Connection.createQueryWithParams
(String queryText, Object... paramValues) Query.setAutoDeriveColumnNames
(boolean autoDeriveColumnNames) Query.setCaseSensitive
(boolean caseSensitive) Query.setColumnMappings
(Map<String, String> mappings) Query.setMaxBatchRecords
(int maxBatchRecords) Sets the number of batched commands this Query allows to be added before implicitly callingexecuteBatch()
fromaddToBatch()
.Query.throwOnMappingFailure
(boolean throwOnMappingFailure) Query.withParams
(Object... paramValues)
Connection
class instead, using try-with-resource blockstry (Connection con = sql2o.open()) { return sql2o.createQuery(query, name).executeAndFetch(Pojo.class); }