|
database b2007102101 |
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectorg.phosphoresce.commons.database.accessor.RecordAccessorAbstract
org.phosphoresce.commons.database.accessor.RecordBufferedAccessor
レコードデータバッファリングアクセスクラス
当クラスはRecordAccessor
インタフェースを実装した基本的なクラスとなります。
ユーザーの指示により、一方方向にフェッチされたレコード、若しくは、指定行のレコードに
対してフェッチされたオブジェクトをクラスが破棄されるまで保持し続けます。
また、RecordAccessor
インタフェースによって提供されているResultSetへの更新処理、
及び、参照処理は、フェッチされたバッファオブジェクトが存在するレコードのみが対象となり、
フェッチが未完了のレコードに対しては処理が行われません。
これは、すべての行に対して無条件に更新、参照処理を行うことによって、レスポンスの低下を
防ぐことを考慮した設計となっています。
ユーザーがすべてのレコード、若しくは特定範囲のレコードを一括して取得したい場合は、
フェッチ処理をユーザーが行う必要があります。
即ち、これらのフェッチ処理方針については、当クラスでは決定せず、ユーザー側に依存します。
なお、バッファリングを行うためのほとんどの処理はfinalで定義され、各サブクラスでは、
これらのインタフェースをオーバーライドすることは許可されません。
これはバッファリング自体の処理は当クラスですべて管理し、各サブクラスではこれらの処理における
例外的な処理の考慮を行う必要をなくすための設計としているためです。
しかし、サブクラスにおいて、これらの処理に連動した任意の処理を行う必要が発生することを想定し、
制限が行われているインタフェースの処理のタイミングでリスナーへの通知を行う処理を提供します。
各サブクラスにおいて、これらの処理に連動した任意の処理を実装する場合は、リスナーより通知された
イベント情報に基づいて、サブクラスに特化した処理を実装することになります。
フィールドの概要 | |
protected java.util.List |
fetchBuffer
フェッチレコードバッファ |
クラス org.phosphoresce.commons.database.accessor.RecordAccessorAbstract から継承したフィールド |
listener, log, resultSet, rowDefinition |
コンストラクタの概要 | |
RecordBufferedAccessor(java.sql.ResultSet resultSet)
コンストラクタ |
メソッドの概要 | |
void |
clearStaticRecords()
同期がとれている静的なレコード情報をすべて削除します。 |
void |
deleteRow(int rowIndex)
指定された行情報に対して削除指示を行います。 |
java.util.List |
fetch(int size)
指定されたサイズ分のレコードフェッチ処理を行います。 |
java.util.List |
fetchAll()
ResultSetが保持するすべてのレコードを取得します。 |
java.util.List |
fetchRemainAll()
現在のカーソル位置から最後尾までのレコードをすべてフェッチします。 |
protected void |
finalize()
オブジェクトの参照がなく、ガベージコレクタによってオブジェクトが不要として破棄される際に呼び出されます。 |
DatabaseError[] |
getErrors()
アクセッサオブジェクトが保持する行でエラーが発生している行オブジェクトを取得します。 |
ResultColumn |
getResultColumn(int rowIndex,
int columnIndex)
指定された行カラム位置のカラムオブジェクトResultSetから直接を取得します。 |
ResultRow |
getResultRow(int rowIndex)
指定された行位置の行オブジェクトをResultSetから直接取得します。 |
boolean |
hasError()
アクセッサオブジェクトが保持する行でエラーが発生しているか判定します。 |
ResultRow |
insertRow()
新規の行情報を生成して、フェッチバッファに追加します。 |
ResultRow |
insertRow(ResultTemplateRow templateRow)
指定されたテンプレート行情報を元に新規の行情報をフェッチバッファに追加します。 |
void |
refreshResult(boolean force)
ResultSetが現在提供する内容で自身のオブジェクトフィールドの更新を行います。 |
protected void |
setResultColumn(int rowIndex,
int columnIndex,
ResultColumn column)
指定された行カラム位置のカラムオブジェクトResultSetから直接を取得します。 |
java.lang.String |
toString()
クラス情報を文字列として提供します。 |
void |
updateResult()
自身が保持する内容をResultSetに対して反映します。 |
クラス org.phosphoresce.commons.database.accessor.RecordAccessorAbstract から継承したメソッド |
createTemplateRow, getResultColumnCount, getResultColumnDefinition, getResultColumnDefinition, getResultRowCount, getResultRowDefinition, getResultSetRowIndex, isReadOnly, moveCurser, refreshResult, validateStateListener |
クラス java.lang.Object から継承したメソッド |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
フィールドの詳細 |
protected java.util.List fetchBuffer
コンストラクタの詳細 |
public RecordBufferedAccessor(java.sql.ResultSet resultSet) throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
resultSet
- ResultSetオブジェクト
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
メソッドの詳細 |
public final void refreshResult(boolean force) throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
force
- 状況に関わらず強制的に更新する場合にtrueを指定、エラーの場合に等の状況によっては更新を行わない場合はfalseを指定。
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生RecordAccessorAbstract.RecordAccessorAbstract(ResultSet)
public final void updateResult() throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生RecordAccessor.updateResult()
public final void clearStaticRecords()
public final ResultRow getResultRow(int rowIndex) throws IllegalResultSetLocationIndexException, ResultSetAccessException, IllegalResultSetAdjustmentException
rowIndex
- 行位置
IllegalResultSetLocationIndexException
- 不正なフェッチ済み行数を指定した場合に発生
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生RecordAccessor.getResultRow(int)
public final ResultColumn getResultColumn(int rowIndex, int columnIndex) throws IllegalResultSetLocationIndexException, ResultSetAccessException, IllegalResultSetAdjustmentException
rowIndex
- 行位置columnIndex
- カラム位置
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生RecordAccessor.getResultColumn(int, int)
public final ResultRow insertRow(ResultTemplateRow templateRow) throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException, IllegalResultTypeException, IllegalTemplateException
templateRow
- テンプレート行情報
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生
IllegalResultTypeException
- 不正なレコード情報タイプのレコードに対して変更を行った場合に発生
IllegalTemplateException
- テンプレート情報が保持する定義情報が自身が提供する定義情報と異なる不正な定義の場合に発生
IllegalColumnValueException
RecordAccessor.insertRow(org.phosphoresce.commons.database.accessor.ResultTemplateRow)
public final ResultRow insertRow() throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生RecordAccessor.insertRow()
public final void deleteRow(int rowIndex) throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
rowIndex
- 行位置(0〜)
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生RecordAccessor.deleteRow(int)
public final java.util.List fetch(int size) throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
size
- フェッチサイズ
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生public final java.util.List fetchRemainAll() throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生public final java.util.List fetchAll() throws ResultSetAccessException, IllegalResultSetLocationIndexException, IllegalResultSetAdjustmentException
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生public final DatabaseError[] getErrors() throws IllegalResultSetLocationIndexException
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生public final boolean hasError() throws IllegalResultSetLocationIndexException
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生protected final void setResultColumn(int rowIndex, int columnIndex, ResultColumn column) throws IllegalResultSetLocationIndexException, ResultSetAccessException, IllegalResultSetAdjustmentException
rowIndex
- 行位置columnIndex
- カラム位置
IllegalResultSetLocationIndexException
- 不正な位置情報を操作した場合に発生
ResultSetAccessException
- 正常にResultSetへの操作が行えなかった場合に発生
IllegalResultSetAdjustmentException
- ResultSetとの整合性が取られていない場合に発生RecordAccessor.getResultColumn(int, int)
protected final void finalize() throws java.lang.Throwable
java.lang.Throwable
- 予期せぬ例外が発生した場合にスローされますObject.finalize()
public java.lang.String toString()
Object.toString()
|
database b2007102101 |
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |