database
b2007102101

org.phosphoresce.commons.database.accessor
インタフェース RecordAccessor

既知の実装クラスの一覧:
RecordAccessorAbstract

public interface RecordAccessor

レコードアクセスクラスインタフェース

各種レコードアクセスクラスは直接的なResultSetへの参照、更新処理を行う実装がされます。
これはレコード情報の一括的なコミット、ロールバックをさけるための設計で、各サブクラスは このレコード更新タイミングを前提とした実装を行う必要があります。
ResultSetへの更新、または参照を行うタイミングは上位ユーザークラスからの指示に依存します。

作成者:
Kitagawa
関連項目:
RecordAccessorAbstract

メソッドの概要
 ResultTemplateRow createTemplateRow()
          ResultSetの情報を元にした定義情報を保持するテンプレート行情報オブジェクトを生成します。
 void deleteRow(int rowIndex)
          指定された行情報に対して削除指示を行います。
 ResultColumn getResultColumn(int rowIndex, int columnIndex)
          指定された行カラム位置のカラムオブジェクトResultSetから直接を取得します。
 int getResultColumnCount()
          レコードカラム数を取得します。
 ResultColumnDefinition getResultColumnDefinition(int columnIndex)
          指定されたカラムインデックスのカラム定義情報を取得します。
 ResultColumnDefinition getResultColumnDefinition(java.lang.String columnName)
          指定されたカラム名のカラム定義情報を取得します。
 ResultRow getResultRow(int rowIndex)
          指定された行位置の行オブジェクトをResultSetから直接取得します。
 int getResultRowCount()
          ResultSetが保持するレコード数を取得します。
 ResultRowDefinition getResultRowDefinition()
          行定義オブジェクトを取得します。
 ResultRow insertRow()
          新規の行情報を生成して追加します。
 ResultRow insertRow(ResultTemplateRow templateRow)
          指定されたテンプレート行情報を元に新規の行情報を追加します。
 boolean isReadOnly()
          レコードアクセスオブジェクトが保持する情報が読み取り専用であるか判定します。
 void refreshResult()
          ResultSetが現在提供する内容で自身のオブジェクトフィールドの更新を行います。
 void refreshResult(boolean force)
          ResultSetが現在提供する内容で自身のオブジェクトフィールドの更新を行います。
 void updateResult()
          自身が保持する内容をResultSetに対して反映します。
 

メソッドの詳細

refreshResult

public void refreshResult(boolean force)
                   throws ResultSetAccessException,
                          IllegalResultSetLocationIndexException,
                          IllegalResultSetAdjustmentException
ResultSetが現在提供する内容で自身のオブジェクトフィールドの更新を行います。

パラメータ:
force - 状況に関わらず強制的に更新する場合にtrueを指定、エラーの場合に等の状況によっては更新を行わない場合はfalseを指定。この動作は具象クラス設計によって異なります。
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

refreshResult

public void refreshResult()
                   throws ResultSetAccessException,
                          IllegalResultSetLocationIndexException,
                          IllegalResultSetAdjustmentException
ResultSetが現在提供する内容で自身のオブジェクトフィールドの更新を行います。
当メソッドで行う更新処理はrefreshResult(boolean)にfalseを指定した動作に委譲します。

例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

updateResult

public void updateResult()
                  throws ResultSetAccessException,
                         IllegalResultSetLocationIndexException,
                         IllegalResultSetAdjustmentException
自身が保持する内容をResultSetに対して反映します。

例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

createTemplateRow

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

戻り値:
テンプレート行情報オブジェクト
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

getResultRowCount

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

戻り値:
ResultSetが保持するレコード数
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

getResultColumnCount

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

戻り値:
レコードカラム数
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

getResultRowDefinition

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

戻り値:
行定義オブジェクト
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

getResultColumnDefinition

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

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

getResultColumnDefinition

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

パラメータ:
columnName - カラム名
戻り値:
カラム定義情報
例外:
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

getResultRow

public ResultRow getResultRow(int rowIndex)
                       throws IllegalResultSetLocationIndexException,
                              ResultSetAccessException,
                              IllegalResultSetAdjustmentException
指定された行位置の行オブジェクトをResultSetから直接取得します。
これは各サブクラスによる動作に依存するインタフェースとなります。
バッファリングを行うクラスではこれらはバッファされたオブジェクトが返却される可能性があります。

パラメータ:
rowIndex - 行位置
戻り値:
行オブジェクト
例外:
IllegalResultSetLocationIndexException - 不正なフェッチ済み行数を指定した場合に発生
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

getResultColumn

public ResultColumn getResultColumn(int rowIndex,
                                    int columnIndex)
                             throws IllegalResultSetLocationIndexException,
                                    ResultSetAccessException,
                                    IllegalResultSetAdjustmentException
指定された行カラム位置のカラムオブジェクトResultSetから直接を取得します。
これは各サブクラスによる動作に依存するインタフェースとなります。
バッファリングを行うクラスではこれらはバッファされたオブジェクトが返却される可能性があります。

パラメータ:
rowIndex - 行位置
columnIndex - カラム位置
戻り値:
カラムオブジェクト
例外:
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

insertRow

public ResultRow insertRow(ResultTemplateRow templateRow)
                    throws ResultSetAccessException,
                           IllegalResultSetLocationIndexException,
                           IllegalResultSetAdjustmentException,
                           IllegalResultTypeException,
                           IllegalTemplateException
指定されたテンプレート行情報を元に新規の行情報を追加します。
これは各サブクラスによる動作に依存するインタフェースとなります。

パラメータ:
templateRow - テンプレート行情報
戻り値:
新規追加行情報
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生
IllegalResultTypeException - 不正なレコード情報タイプのレコードに対して変更を行った場合に発生
IllegalTemplateException - テンプレート情報が保持する定義情報が自身が提供する定義情報と異なる不正な定義の場合に発生

insertRow

public ResultRow insertRow()
                    throws ResultSetAccessException,
                           IllegalResultSetLocationIndexException,
                           IllegalResultSetAdjustmentException
新規の行情報を生成して追加します。
これは各サブクラスによる動作に依存するインタフェースとなります。

戻り値:
新規追加行情報
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

deleteRow

public void deleteRow(int rowIndex)
               throws ResultSetAccessException,
                      IllegalResultSetLocationIndexException,
                      IllegalResultSetAdjustmentException
指定された行情報に対して削除指示を行います。
これは各サブクラスによる動作に依存するインタフェースとなります。

パラメータ:
rowIndex - 行位置(0〜)
例外:
ResultSetAccessException - 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException - 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException - ResultSetとの整合性が取られていない場合に発生

isReadOnly

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

戻り値:
レコードアクセスオブジェクトが保持する情報が読み取り専用である場合にtrueを返却
例外:
DatabaseConnectionException - 正常にデータベースコネクションにアクセスできなかった場合に発生

database
b2007102101