public class Query extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
parameters |
protected String |
parsedSql |
protected Class |
returnType |
protected String[] |
roles |
protected SqlSession |
session |
protected String |
sql |
protected List<Object> |
sqlParameters |
| Constructor and Description |
|---|
Query(SqlSession session,
String sql,
Map<String,Object> parameters,
Class<?> returnType) |
Query(SqlSession session,
String sql,
String[] roles,
Map<String,Object> parameters,
Class<?> returnType) |
| Modifier and Type | Method and Description |
|---|---|
String |
addSqlParameter(Object value) |
Object |
evalField(Object o,
String path) |
Object |
evalField(String path) |
Object |
evalFunction(Object value,
String name,
List args) |
boolean |
execute() |
<E> E |
executeQuery() |
<E> E |
executeUpdate() |
protected Object |
getFirstValue(com.fasterxml.jackson.databind.ObjectMapper mapper,
String json) |
protected String |
getFormattedRoles() |
String |
getParsedSql() |
protected <E> E |
getResult(PreparedStatement statement) |
SqlSession |
getSession() |
protected PreparedStatement |
getStatement(String sql) |
protected Collection |
getValues(com.fasterxml.jackson.databind.ObjectMapper mapper,
String json) |
protected String |
parseParameters(String sql) |
protected SqlSession session
protected String sql
protected String[] roles
protected Class returnType
protected String parsedSql
public Query(SqlSession session, String sql, String[] roles, Map<String,Object> parameters, Class<?> returnType) throws Exception
Exceptionpublic String getParsedSql() throws SQLException
SQLExceptionpublic String addSqlParameter(Object value)
value - object to used as parameter for sql querypublic SqlSession getSession()
protected PreparedStatement getStatement(String sql) throws SQLException
SQLExceptionprotected String getFormattedRoles()
protected <E> E getResult(PreparedStatement statement) throws SQLException, IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException
protected Object getFirstValue(com.fasterxml.jackson.databind.ObjectMapper mapper, String json) throws IOException
IOExceptionprotected Collection getValues(com.fasterxml.jackson.databind.ObjectMapper mapper, String json) throws IOException
IOExceptionpublic <E> E executeUpdate()
throws SQLException,
Exception
SQLExceptionExceptionpublic boolean execute()
throws SQLException
SQLExceptionCopyright © 2017–2018 CodeLutin. All rights reserved.