jp.terasoluna.fw.collector.db
クラス Queueing1NRelationDataRowHandlerImpl

java.lang.Object
  上位を拡張 jp.terasoluna.fw.collector.db.QueueingDataRowHandlerImpl
      上位を拡張 jp.terasoluna.fw.collector.db.Queueing1NRelationDataRowHandlerImpl
すべての実装されたインタフェース:
QueueingDataRowHandler, jp.terasoluna.fw.dao.event.DataRowHandler

public class Queueing1NRelationDataRowHandlerImpl
extends QueueingDataRowHandlerImpl
implements QueueingDataRowHandler

Queueing1NRelationDataRowHandlerImplの実装クラス

IBatisDbCollectorImplの1:Nマッピング対応版。
1:Nマッピング使用時、iBATISは1:N構造のオブジェクトが完成する前に RowHandler#handleRow(DataRowHandler#handleRow)に渡すため、 このコレクタでは、 RowHandler#handleRow(DataRowHandler#handleRow)に渡された結果を、次回同メソッドが実行されたときに キューに格納する。 最後に渡された結果は、iBATISが処理を終えた時点でキューに格納する。
また、1:Nマッピング使用時、iBATISは全てのデータを取得し終わるまで、 RowHandler#handleRow(DataRowHandler#handleRow)に渡したオブジェクトを、全てiBATIS内部に保持し続けるため、 このコレクタでは、RowHandler#handleRow(DataRowHandler#handleRow)に渡されたオブジェクトのシャローコピーをキューに格納し、 RowHandler#handleRow(DataRowHandler#handleRow)に渡されたオブジェクトの全プロパティを初期化する。

使用上の注意:

使いどころ

sqlMap記述例1(1:Nマッピング):

 <resultMap id="rmap_JB1231_SQL" class="sample.JB1231Data" <b>groupBy="col1"</b>>
   <result property="col1"/>
   <result property="col2"/>
   <result property="col3"/>
   <result property="detail1" resultMap="rmap_JB1231_SQL_detail1"/>
 </resultMap>
 <resultMap id="rmap_JB1231_SQL_detail1" class="sample.Detail1">
   <result property="d12" column="d12"/>
   <result property="d13" column="d13"/>
 </resultMap>
 <select id="JB1231_SQL" resultMap="rmap_JB1231_SQL">
     SELECT
       t1.col1 as col1,
       t1.col2 as col2,
       t1.col3 as col3,
       d1.col2 as d12,
       d1.col3 as d13,
     FROM (sample_table1 t1
       left outer join sample_table1_detail1 d1 on t1.col1 = d1.col1)
     <b>ORDER BY col1</b>, ...
 </select>
 
sqlMap記述例2(1:M:Nマッピング):
 <resultMap id="rmap_JB1231_SQL" class="sample.JB1231Data" <b>groupBy="col1"</b>>
   <result property="col1"/>
   <result property="col2"/>
   <result property="col3"/>
   <result property="detail1" resultMap="rmap_JB1231_SQL_detail1"/>
   <result property="detail2" resultMap="rmap_JB1231_SQL_detail2"/>
 </resultMap>
 <resultMap id="rmap_JB1231_SQL_detail1" class="sample.Detail1">
   <result property="d12" column="d12"/>
   <result property="d13" column="d13"/>
 </resultMap>
 <resultMap id="rmap_JB1231_SQL_detail2" class="sample.Detail2">
   <result property="d22" column="d22"/>
   <result property="d23" column="d23"/>
 </resultMap>
 <select id="JB1231_SQL" resultMap="rmap_JB1231_SQL">
   SELECT * FROM (
     SELECT
       t1.col1 as col1,
       t1.col2 as col2,
       t1.col3 as col3,
       d1.col2 as d12,
       d1.col3 as d13,
       null as d22,
       null as d23
     FROM (sample_table1 t1
       left outer join sample_table1_detail1 d1 on t1.col1 = d1.col1)
     UNION ALL
     SELECT
       t1.col1 as col1,
       t1.col2 as col2,
       t1.col3 as col3,
       null as d12,
       null as d13,
       d2.col2 as d22,
       d2.col3 as d23
     FROM (sample_table1 t1
       left outer join sample_table1_detail2 d2 on t1.col1 = d2.col1)
   ) AS A <b>ORDER BY col1</b>, ...
 </select>
 


フィールドの概要
 
クラス jp.terasoluna.fw.collector.db.QueueingDataRowHandlerImpl から継承されたフィールド
dataCount, dbCollector, interrupted, prevRow, verboseLog
 
コンストラクタの概要
Queueing1NRelationDataRowHandlerImpl()
           
 
メソッドの概要
 void delayCollect()
          前回handleRowメソッドに渡されたRowデータをキューに格納する。
 
クラス jp.terasoluna.fw.collector.db.QueueingDataRowHandlerImpl から継承されたメソッド
handleRow, setDbCollector, setVerbose
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース jp.terasoluna.fw.collector.db.QueueingDataRowHandler から継承されたメソッド
setDbCollector
 
インタフェース jp.terasoluna.fw.dao.event.DataRowHandler から継承されたメソッド
handleRow
 

コンストラクタの詳細

Queueing1NRelationDataRowHandlerImpl

public Queueing1NRelationDataRowHandlerImpl()
メソッドの詳細

delayCollect

public void delayCollect()
前回handleRowメソッドに渡されたRowデータをキューに格納する。

定義:
インタフェース QueueingDataRowHandler 内の delayCollect
オーバーライド:
クラス QueueingDataRowHandlerImpl 内の delayCollect


Copyright © 2011. All Rights Reserved.