public class DefaultSqlSession extends java.lang.Object implements SqlSession
SqlSession.Function<T,R>
限定符和类型 | 字段和说明 |
---|---|
protected SqLinkConfig |
config |
protected DataSourceManager |
dataSourceManager |
protected TransactionManager |
transactionManager |
构造器和说明 |
---|
DefaultSqlSession(SqLinkConfig config,
DataSourceManager dataSourceManager,
TransactionManager transactionManager) |
限定符和类型 | 方法和说明 |
---|---|
long |
executeDelete(java.lang.String sql,
java.util.Collection<SqlValue> sqlValues)
执行删除,并返回影响行数
|
protected long |
executeInsert(java.sql.Connection connection,
java.lang.String sql,
java.util.Collection<SqlValue> sqlValues,
int length) |
long |
executeInsert(java.lang.String sql,
java.util.Collection<SqlValue> sqlValues,
int length)
执行插入,并返回影响行数
|
<R> R |
executeQuery(SqlSession.Function<java.sql.ResultSet,R> func,
java.lang.String sql,
java.util.Collection<SqlValue> sqlValues)
执行查询,并返回结果
|
protected long |
executeUpdate(java.sql.Connection connection,
java.lang.String sql,
java.util.Collection<SqlValue> sqlValues) |
long |
executeUpdate(java.lang.String sql,
java.util.Collection<SqlValue> sqlValues)
执行更新,并返回影响行数
|
protected void |
setObjects(java.sql.PreparedStatement preparedStatement,
java.util.Collection<SqlValue> sqlValues) |
protected boolean |
setObjects(java.sql.PreparedStatement preparedStatement,
java.util.Collection<SqlValue> sqlValues,
int length) |
protected final SqLinkConfig config
protected final DataSourceManager dataSourceManager
protected final TransactionManager transactionManager
public DefaultSqlSession(SqLinkConfig config, DataSourceManager dataSourceManager, TransactionManager transactionManager)
public <R> R executeQuery(SqlSession.Function<java.sql.ResultSet,R> func, java.lang.String sql, java.util.Collection<SqlValue> sqlValues)
SqlSession
executeQuery
在接口中 SqlSession
func
- 对ResultSet进行操作并且返回结果sql
- sql语句sqlValues
- 参数public long executeInsert(java.lang.String sql, java.util.Collection<SqlValue> sqlValues, int length)
SqlSession
executeInsert
在接口中 SqlSession
sql
- sql语句sqlValues
- 参数length
- 批量下每轮的长度public long executeDelete(java.lang.String sql, java.util.Collection<SqlValue> sqlValues)
SqlSession
executeDelete
在接口中 SqlSession
sql
- sql语句sqlValues
- 参数public long executeUpdate(java.lang.String sql, java.util.Collection<SqlValue> sqlValues)
SqlSession
executeUpdate
在接口中 SqlSession
sql
- sql语句sqlValues
- 参数protected long executeInsert(java.sql.Connection connection, java.lang.String sql, java.util.Collection<SqlValue> sqlValues, int length)
protected long executeUpdate(java.sql.Connection connection, java.lang.String sql, java.util.Collection<SqlValue> sqlValues)
protected void setObjects(java.sql.PreparedStatement preparedStatement, java.util.Collection<SqlValue> sqlValues) throws java.sql.SQLException
java.sql.SQLException
protected boolean setObjects(java.sql.PreparedStatement preparedStatement, java.util.Collection<SqlValue> sqlValues, int length) throws java.sql.SQLException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.sql.SQLException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException