當前位置: 首頁>>代碼示例>>Java>>正文


Java StatementHandler.query方法代碼示例

本文整理匯總了Java中org.apache.ibatis.executor.statement.StatementHandler.query方法的典型用法代碼示例。如果您正苦於以下問題:Java StatementHandler.query方法的具體用法?Java StatementHandler.query怎麽用?Java StatementHandler.query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.ibatis.executor.statement.StatementHandler的用法示例。


在下文中一共展示了StatementHandler.query方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doQuery

import org.apache.ibatis.executor.statement.StatementHandler; //導入方法依賴的package包/類
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql)
    throws SQLException {
  Statement stmt = null;
  try {
    flushStatements();
    Configuration configuration = ms.getConfiguration();
    StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameterObject, rowBounds, resultHandler, boundSql);
    Connection connection = getConnection(ms.getStatementLog());
    stmt = handler.prepare(connection, transaction.getTimeout());
    handler.parameterize(stmt);
    return handler.<E>query(stmt, resultHandler);
  } finally {
    closeStatement(stmt);
  }
}
 
開發者ID:yuexiahandao,項目名稱:MybatisCode,代碼行數:17,代碼來源:BatchExecutor.java

示例2: doQuery

import org.apache.ibatis.executor.statement.StatementHandler; //導入方法依賴的package包/類
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql)
    throws SQLException {
  Statement stmt = null;
  try {
    flushStatements();
    Configuration configuration = ms.getConfiguration();
    StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameterObject, rowBounds, resultHandler, boundSql);
    Connection connection = getConnection(ms.getStatementLog());
    stmt = handler.prepare(connection);
    handler.parameterize(stmt);
    return handler.<E>query(stmt, resultHandler);
  } finally {
    closeStatement(stmt);
  }
}
 
開發者ID:shurun19851206,項目名稱:mybaties,代碼行數:17,代碼來源:BatchExecutor.java

示例3: doQuery

import org.apache.ibatis.executor.statement.StatementHandler; //導入方法依賴的package包/類
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
  Statement stmt = null;
  try {
    Configuration configuration = ms.getConfiguration();
    //新建一個StatementHandler
    //這裏看到ResultHandler傳入了
    StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql);
    //準備語句
    stmt = prepareStatement(handler, ms.getStatementLog());
    //StatementHandler.query
    return handler.<E>query(stmt, resultHandler);
  } finally {
    closeStatement(stmt);
  }
}
 
開發者ID:shurun19851206,項目名稱:mybaties,代碼行數:17,代碼來源:SimpleExecutor.java

示例4: doQuery

import org.apache.ibatis.executor.statement.StatementHandler; //導入方法依賴的package包/類
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
  Configuration configuration = ms.getConfiguration();
  StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql);
  Statement stmt = prepareStatement(handler, ms.getStatementLog());
  return handler.<E>query(stmt, resultHandler);
}
 
開發者ID:yuexiahandao,項目名稱:MybatisCode,代碼行數:8,代碼來源:ReuseExecutor.java

示例5: doQuery

import org.apache.ibatis.executor.statement.StatementHandler; //導入方法依賴的package包/類
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
  Statement stmt = null;
  try {
    Configuration configuration = ms.getConfiguration();
    StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql);
    stmt = prepareStatement(handler, ms.getStatementLog());
    return handler.<E>query(stmt, resultHandler);
  } finally {
    closeStatement(stmt);
  }
}
 
開發者ID:yuexiahandao,項目名稱:MybatisCode,代碼行數:13,代碼來源:SimpleExecutor.java

示例6: doQuery

import org.apache.ibatis.executor.statement.StatementHandler; //導入方法依賴的package包/類
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
  Statement stmt = null;
  try {
    // 源碼解析: 獲取配置
    Configuration configuration = ms.getConfiguration();

    StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql);
    stmt = prepareStatement(handler, ms.getStatementLog());
    return handler.<E>query(stmt, resultHandler);
  } finally {
    closeStatement(stmt);
  }
}
 
開發者ID:txazo,項目名稱:mybatis,代碼行數:15,代碼來源:SimpleExecutor.java

示例7: doQuery

import org.apache.ibatis.executor.statement.StatementHandler; //導入方法依賴的package包/類
@Override
public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
  Statement stmt = null;
  try {
    Configuration configuration = ms.getConfiguration();
    //5. 根據既有的參數,創建StatementHandler對象來執行查詢操作
    StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql);
    //6. 創建java.Sql.Statement對象,傳遞給StatementHandler對象
    stmt = prepareStatement(handler, ms.getStatementLog());
    //7. 調用StatementHandler.query()方法,返回List結果集  
    return handler.<E>query(stmt, resultHandler);
  } finally {
    closeStatement(stmt);
  }
}
 
開發者ID:toulezu,項目名稱:play,代碼行數:16,代碼來源:SimpleExecutor.java


注:本文中的org.apache.ibatis.executor.statement.StatementHandler.query方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。