001    /*
002     * Copyright (c) 2009 The openGion Project.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013     * either express or implied. See the License for the specific language
014     * governing permissions and limitations under the License.
015     */
016    package org.opengion.hayabusa.db;
017    
018    import java.util.Map;
019    
020    import org.opengion.fukurou.util.ErrorMessage;
021    import org.opengion.fukurou.db.Transaction;
022    import org.opengion.hayabusa.common.HybsSystem;
023    import org.opengion.hayabusa.resource.ResourceManager;
024    
025    /**
026     * TableFilter は、TableFilterTag で使用され?DBTableModelの処?のインターフェースです?
027     * 適?実?サブクラス)?TableFilterTag に与えることで?DBTableModelの処?適?
028     * ?替えることが?来ます?
029     *
030     * @og.rev 3.8.5.0 (2006/03/20) 新規作?
031     * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
032     *
033     * @version  0.9.0  2000/10/17
034     * @author   Kazuhiko Hasegawa
035     * @since    JDK1.1,
036     */
037    public interface TableFilter {
038            /** CR 定義 */
039            public static final String CR = HybsSystem.CR ;         // 5.1.1.0 (2009/12/01) CR 定義をここで行う?
040    
041            /**
042             * DBTableModelの処?実行します?
043             * 処??体?, ?ブクラスの実?依存します?
044             *
045             * @return      DBTableModelオブジェク?
046             */
047            DBTableModel execute() ;
048    
049            /**
050             * DBTableModel をセ?します?
051             *
052             * @param       table DBTableModelオブジェク?
053             */
054            void setDBTableModel( DBTableModel table ) ;
055    
056            /**
057             * DBTableModel を取得します?
058             *
059             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
060             *
061             * @return      ?のDBTableModel
062             */
063            DBTableModel getDBTableModel() ;
064    
065            /**
066             * ??タ処??方?A:追?C:更新 D:削除)を指定します?
067             *
068             * 通常は、DBTableModel に自動設定されて? modifyType を?に、データ処?法を
069             * 選別します?(A:追?C:更新 D:削除)
070             * こ?場合?行単位で modifyType の値を取得して判別する?がありますが、?には
071             * 処?象は、?件おな?modifyType である可能性が高いです?
072             * また?selectedAll などで強制?全件処?象とする場合?、modifyType に値?
073             * 設定さて?せん。その様な場合に外部より modifyType を指定します?
074             * 初期値は、?動判?です?
075             *
076             * @param  type ??タ処??方?A:追?C:更新 D:削除)
077             */
078            void setModifyType( String type ) ;
079    
080            /**
081             * ??タ処??方?A:追?C:更新 D:削除)を取得します?
082             *
083             * 初期値は、?動判?です?
084             *
085             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
086             *
087             * @return  ??タ処??方?A:追?C:更新 D:削除)
088             */
089            String getModifyType() ;
090    
091            /**
092             * キーと値のペアの変数配?を受け取ります?
093             *
094             * ここでは、この方式以外に、パラメーターMapを受け取る方法もあります?
095             *
096             * keys,vals とパラメーターMapを同時に?した?合?、両方とも有効です?
097             * ただし?キーが重?た?合?、不定と?てください?
098             *
099             * @param   keys キー配?
100             * @param   vals 値配?
101             */
102            void setKeysVals( String[] keys,String[] vals ) ;
103    
104            /**
105             * 選択された行番号の配?をセ?します?
106             *
107             * 表示??タの HybsSystem.ROW_SEL_KEY を?に?ばれた 行を
108             * 処??対象とします?
109             *
110             * @param   rowNo 行番号の配?
111             */
112            void setParameterRows( int[] rowNo ) ;
113    
114            /**
115             * 選択された行番号の配?を取得します?
116             *
117             * 表示??タの HybsSystem.ROW_SEL_KEY を?に?ばれた 行を
118             * 処??対象とします?
119             *
120             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
121             *
122             * @return  行番号の配?
123             */
124            int[] getParameterRows() ;
125    
126            /**
127             * アクセスログ取得?為,ApplicationInfoオブジェクトを設定します?
128             *
129             * @og.rev 3.8.7.0 (2006/12/15) 新規追?
130             * @og.rev 5.1.9.0 (2010/08/01) Transaction 対?のため、?
131             *
132             * @param   appInfo ApplicationInfo
133             */
134    //      void setApplicationInfo( ApplicationInfo appInfo ) ;
135    
136            /**
137             * アクセスログ取得?為,Transactionオブジェクトを設定します?
138             *
139             * @og.rev 5.1.9.0 (2010/08/01) Transaction 対?新規追?
140             *
141             * @param   tran Transactionオブジェク?
142             */
143            void setTransaction( Transaction tran ) ;
144    
145            /**
146             * アクセスログ取得?為,Transactionオブジェクトを取得します?
147             *
148             * @og.rev 5.1.9.0 (2010/08/01) Transaction 対?新規追?
149             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
150             *
151             * @return      Transactionオブジェク?
152             */
153            Transaction getTransaction() ;
154    
155            /**
156             * DBIDを指定します?
157             *
158             * @og.rev 4.2.4.0 (2008/06/23) 新規追?
159             *
160             * @param dbid 接続?ID
161             */
162            void setDbid( String dbid ) ;
163    
164            /**
165             * DBIDを取得します?
166             *
167             * @og.rev 4.2.4.0 (2008/06/23) 新規追?
168             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
169             *
170             * @return DBID(接続?ID)
171             */
172            String getDbid() ;
173    
174            /**
175             * ボディー部??SQLを指定します?
176             *
177             * @og.rev 4.2.4.0 (2008/06/23) 新規追?
178             *
179             * @param sql ボディー部??SQL
180             */
181            void setSql( String sql ) ;
182    
183            /**
184             * ボディー部??SQLを取得します?
185             *
186             * @og.rev 4.2.4.0 (2008/06/23) 新規追?
187             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
188             *
189             * @return ボディー部??SQL
190             */
191            String getSql() ;
192    
193            /**
194             * パラメーターMapを指定します?
195             *
196             * keys,vals と パラメーターMapを同時に?した?合?、両方とも有効です?
197             * ただし?キーが重?た?合?、不定と?てください?
198             *
199             * @og.rev  5.6.5.2 (2013/06/21) 新規追?
200             *
201             * @param paramMap パラメーターMap
202             */
203            void setParamMap( Map<String,String> paramMap ) ;
204    
205            /**
206             * リソースオブジェクトを?します?
207             *
208             * @og.rev 4.3.7.4 (2009/07/01) 新規追?
209             *
210             * @param resource リソースオブジェク?
211             */
212            void setResource( ResourceManager resource ) ;
213    
214            /**
215             * リソースオブジェクトを取得します?
216             *
217             * @og.rev 4.3.7.4 (2009/07/01) 新規追?
218             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
219             *
220             * @return リソースオブジェク?
221             */
222            ResourceManager getResource() ;
223    
224            /**
225             * ????を表示するかど?[true/false]を指定します?
226             * true で????を表示します?
227             *
228             * @param   flag 表示するかど?[true:表示する/false:表示しない]
229             */
230            void setDebug( boolean flag ) ;
231    
232            /**
233             * ????を表示するかど?[true/false]を取得します?
234             * true で????を表示します?
235             *
236             * @og.rev 5.5.2.6 (2012/05/25) インターフェースにgetterメソ?追?
237             *
238             * @return  ????[true:表示する/false:表示しない]
239             */
240            boolean isDebug() ;
241    
242            /**
243             * エラーコー?を取得します?
244             * エラーコー?は、ErrorMessage クラスで規定されて?コードです?
245             *
246             * @return   エラーコー?
247             */
248            int getErrorCode() ;
249    
250            /**
251             * エラーメ?ージオブジェク?を取得します?
252             *
253             * @return   エラーメ?ージオブジェク?
254             */
255            ErrorMessage getErrorMessage() ;
256    }