jp.terasoluna.fw.web.codelist
クラス DBCodeListQuery

java.lang.Object
  上位を拡張 org.springframework.jdbc.object.RdbmsOperation
      上位を拡張 org.springframework.jdbc.object.SqlOperation
          上位を拡張 org.springframework.jdbc.object.SqlQuery
              上位を拡張 org.springframework.jdbc.object.MappingSqlQueryWithParameters
                  上位を拡張 org.springframework.jdbc.object.MappingSqlQuery
                      上位を拡張 jp.terasoluna.fw.web.codelist.DBCodeListQuery
すべての実装されたインタフェース:
org.springframework.beans.factory.InitializingBean

public class DBCodeListQuery
extends org.springframework.jdbc.object.MappingSqlQuery

データベースからコードリスト取得を行う RDBMSオペレーションクラス。 データベースに接続するデータソースと使用するSQL文をコンストラクタで指定して、 executeメソッドを実行することで、データベースからコードリストを取得することが できる。 このクラスは DBCodeListLoader でのみ利用される。


入れ子のクラスの概要
 
クラス org.springframework.jdbc.object.MappingSqlQueryWithParameters から継承された入れ子のクラス/インタフェース
org.springframework.jdbc.object.MappingSqlQueryWithParameters.RowMapperImpl
 
フィールドの概要
 
クラス org.springframework.jdbc.object.RdbmsOperation から継承されたフィールド
logger
 
コンストラクタの概要
DBCodeListQuery(javax.sql.DataSource dataSource, java.lang.String sql)
          データソースとSQL文の設定を行うコンストラクタ。
 
メソッドの概要
private  CodeBean createCodeBean(java.sql.ResultSet rs)
          ResultSetから値を取得し、CodeBeanインスタンスを生成する。
protected  java.lang.Object mapRow(java.sql.ResultSet rs, int rowNum)
          1行取得するごとに呼ばれる。
 
クラス org.springframework.jdbc.object.MappingSqlQuery から継承されたメソッド
mapRow
 
クラス org.springframework.jdbc.object.MappingSqlQueryWithParameters から継承されたメソッド
newRowMapper
 
クラス org.springframework.jdbc.object.SqlQuery から継承されたメソッド
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, getRowsExpected, setRowsExpected
 
クラス org.springframework.jdbc.object.SqlOperation から継承されたメソッド
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
 
クラス org.springframework.jdbc.object.RdbmsOperation から継承されたメソッド
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

DBCodeListQuery

public DBCodeListQuery(javax.sql.DataSource dataSource,
                       java.lang.String sql)
データソースとSQL文の設定を行うコンストラクタ。

パラメータ:
dataSource - データベース接続に使用するデータソース。
sql - コードリスト取得に使用するSQL文。
メソッドの詳細

mapRow

protected java.lang.Object mapRow(java.sql.ResultSet rs,
                                  int rowNum)
                           throws java.sql.SQLException
1行取得するごとに呼ばれる。

取得した行の1列目をidと2列目をnameとしてデータベースから取得した値と CodeBeanインスタンスを結びつける。

定義:
クラス org.springframework.jdbc.object.MappingSqlQuery 内の mapRow
パラメータ:
rs - 現在の行情報を持つResultSet。
rowNum - 現在参照している行番号。(最初は0行目)
戻り値:
取得した結果が格納されたインスタンス。
例外:
java.sql.SQLException - SQL例外。

createCodeBean

private CodeBean createCodeBean(java.sql.ResultSet rs)
                         throws java.sql.SQLException
ResultSetから値を取得し、CodeBeanインスタンスを生成する。

パラメータ:
rs - 値を保持するResultSet。
戻り値:
値が格納されたCodeBeanインスタンス。
例外:
java.sql.SQLException - SQL例外。