database
b2007102101

org.phosphoresce.commons.database.accessor
クラス RecordAccessorAbstract

java.lang.Object
  拡張org.phosphoresce.commons.database.accessor.RecordAccessorAbstract
すべての実装インタフェース:
RecordAccessor
直系の既知のサブクラス:
RecordBufferedAccessor

public abstract class RecordAccessorAbstract
extends java.lang.Object
implements RecordAccessor

レコードアクセスクラス抽象クラス

当クラスはレコードアクセスにおける共通のインタフェース及びフィールドを提供します。
各種アクセスサブクラスはこれを継承して、サブクラスに特化した動作を実装します。

また、実装するサブクラスにおいて、各エレメントクラスの状態が変更されたことによる、 任意の処理を行う場合は、自身のクラスに特化したリスナークラスを設け、それをエレメントクラス に提供し、状態の変更が行われたタイミングで、そのリスナーにイベントを通知して貰います。
なお、リスナークラスの提供は必須ではありません。

作成者:
Kitagawa

フィールドの概要
protected  org.phosphoresce.commons.database.accessor.ResultAccessorListener listener
          状態管理リスナーオブジェクト
protected  org.apache.commons.logging.Log log
          ロガーオブジェクト
protected  java.sql.ResultSet resultSet
          ResultSetオブジェクト
protected  ResultRowDefinition rowDefinition
          レコード定義情報オブジェクト
 
コンストラクタの概要
protected RecordAccessorAbstract(java.sql.ResultSet resultSet)
          コンストラクタ
 
メソッドの概要
 ResultTemplateRow createTemplateRow()
          ResultSetの情報を元にした定義情報を保持するテンプレート行情報オブジェクトを生成します。
 int getResultColumnCount()
          レコードカラム数を取得します。
 ResultColumnDefinition getResultColumnDefinition(int columnIndex)
          指定されたカラムインデックスのカラム定義情報を取得します。
 ResultColumnDefinition getResultColumnDefinition(java.lang.String columnName)
          指定されたカラム名のカラム定義情報を取得します。
 int getResultRowCount()
          ResultSetが保持するレコード数を取得します。
 ResultRowDefinition getResultRowDefinition()
          行定義オブジェクトを取得します。
protected  int getResultSetRowIndex()
          現在アクティブなResultSetオブジェクトの行位置を取得します。
 boolean isReadOnly()
          レコードアクセスオブジェクトが保持する情報が読み取り専用であるか判定します。
protected  void moveCurser(int rowIndex)
          指定された行位置(ResultSet仕様に伴い、1〜)にカーソルを移動します。
 void refreshResult()
          ResultSetが現在提供する内容で自身のオブジェクトフィールドの更新を行います。
protected  boolean validateStateListener()
          状態管理リスナーオブジェクトが有効であるか判定します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.phosphoresce.commons.database.accessor.RecordAccessor から継承したメソッド
deleteRow, getResultColumn, getResultRow, insertRow, insertRow, refreshResult, updateResult
 

フィールドの詳細

log

protected org.apache.commons.logging.Log log
ロガーオブジェクト


resultSet

protected java.sql.ResultSet resultSet
ResultSetオブジェクト


rowDefinition

protected ResultRowDefinition rowDefinition
レコード定義情報オブジェクト


listener

protected org.phosphoresce.commons.database.accessor.ResultAccessorListener listener
状態管理リスナーオブジェクト

コンストラクタの詳細

RecordAccessorAbstract

protected RecordAccessorAbstract(java.sql.ResultSet resultSet)
                          throws ResultSetAccessException,
                                 IllegalResultSetAdjustmentException,
                                 IllegalResultSetLocationIndexException
コンストラクタ

パラメータ:
resultSet - ResultSetオブジェクト
例外:
ResultSetAccessException - 不正なResultSetオブジェクトを指定した場合に発生
IllegalResultSetAdjustmentException - 指定されたReusltSetオブジェクトのカーソル位置が先頭手前になっていない場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
メソッドの詳細

refreshResult

public final void refreshResult()
                         throws ResultSetAccessException,
                                IllegalResultSetLocationIndexException,
                                IllegalResultSetAdjustmentException
ResultSetが現在提供する内容で自身のオブジェクトフィールドの更新を行います。
現在、変更が行われている内容はすべて破棄され、ResultSet上の情報で更新されます。

定義:
インタフェース RecordAccessor 内の refreshResult
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
関連項目:
RecordAccessor.refreshResult()

createTemplateRow

public final ResultTemplateRow createTemplateRow()
                                          throws ResultSetAccessException,
                                                 IllegalResultSetLocationIndexException,
                                                 IllegalResultSetAdjustmentException
ResultSetの情報を元にした定義情報を保持するテンプレート行情報オブジェクトを生成します。

定義:
インタフェース RecordAccessor 内の createTemplateRow
戻り値:
テンプレート行情報オブジェクト
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
関連項目:
RecordAccessor.createTemplateRow()

getResultRowCount

public final int getResultRowCount()
                            throws ResultSetAccessException,
                                   IllegalResultSetAdjustmentException
ResultSetが保持するレコード数を取得します。

定義:
インタフェース RecordAccessor 内の getResultRowCount
戻り値:
ResultSetが保持するレコード数
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
関連項目:
RecordAccessor.getResultRowCount()

getResultColumnCount

public final int getResultColumnCount()
                               throws ResultSetAccessException,
                                      IllegalResultSetAdjustmentException
レコードカラム数を取得します。

定義:
インタフェース RecordAccessor 内の getResultColumnCount
戻り値:
レコードカラム数
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
関連項目:
RecordAccessor.getResultColumnCount()

getResultRowDefinition

public final ResultRowDefinition getResultRowDefinition()
                                                 throws ResultSetAccessException,
                                                        IllegalResultSetAdjustmentException
行定義オブジェクトを取得します。

定義:
インタフェース RecordAccessor 内の getResultRowDefinition
戻り値:
行定義オブジェクト
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
関連項目:
RecordAccessor.getResultRowDefinition()

getResultColumnDefinition

public final ResultColumnDefinition getResultColumnDefinition(int columnIndex)
                                                       throws IllegalResultSetLocationIndexException,
                                                              ResultSetAccessException,
                                                              IllegalResultSetAdjustmentException
指定されたカラムインデックスのカラム定義情報を取得します。

定義:
インタフェース RecordAccessor 内の getResultColumnDefinition
パラメータ:
columnIndex - カラムインデックス
戻り値:
カラム定義情報
例外:
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
関連項目:
RecordAccessor.getResultColumnDefinition(int)

getResultColumnDefinition

public final ResultColumnDefinition getResultColumnDefinition(java.lang.String columnName)
                                                       throws IllegalResultSetLocationIndexException,
                                                              ResultSetAccessException,
                                                              IllegalResultSetAdjustmentException
指定されたカラム名のカラム定義情報を取得します。

定義:
インタフェース RecordAccessor 内の getResultColumnDefinition
パラメータ:
columnName - カラム名
戻り値:
カラム定義情報
例外:
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
関連項目:
RecordAccessor.getResultColumnDefinition(java.lang.String)

isReadOnly

public final boolean isReadOnly()
                         throws DatabaseConnectionException
レコードアクセスオブジェクトが保持する情報が読み取り専用であるか判定します。

定義:
インタフェース RecordAccessor 内の isReadOnly
戻り値:
レコードアクセスオブジェクトが保持する情報が読み取り専用である場合にtrueを返却
例外:
DatabaseConnectionException - 正常にデータベースコネクションにアクセスできなかった場合に発生
関連項目:
RecordAccessor.isReadOnly()

getResultSetRowIndex

protected final int getResultSetRowIndex()
                                  throws ResultSetAccessException
現在アクティブなResultSetオブジェクトの行位置を取得します。

戻り値:
現在アクティブなResultSetオブジェクトの行位置
例外:
ResultSetAccessException - 正常にカーソル移動が行えなかった場合に発生

moveCurser

protected final void moveCurser(int rowIndex)
                         throws ResultSetAccessException
指定された行位置(ResultSet仕様に伴い、1〜)にカーソルを移動します。

パラメータ:
rowIndex - 行位置(1〜)
例外:
ResultSetAccessException - 正常にカーソル移動が行えなかった場合に発生

validateStateListener

protected final boolean validateStateListener()
状態管理リスナーオブジェクトが有効であるか判定します。

戻り値:
状態管理リスナーオブジェクトが有効である場合trueを返却

database
b2007102101