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.plugin.table; 017 018 /** 019 * TableFilter_SEQUENCE_HSQLDB は、TableUpda インターフェースを継承した、DBTableModel 処?の 020 * 実?ラスです? 021 * 022 * ここでは、シーケンス?の検索結果より、GF09 のシーケンス定義??ブルから 023 * ?な??を取得し、シーケンス作?スクリプトを作?します? 024 * 025 * こ?処?実行するには、DBTableModelのカラ?して? 026 * SEQNAME,INCREBY,STARTVAL,MINVAL,MAXVAL,FGCYCLE,SUCACHE 027 * が?です? 028 * 029 * ※HSQLDBに対して生?されるスクリプトでは、MINVAL,MAXVAL,FGCYCLE,SUCACHEは無視されます? 030 * 031 * @og.rev 5.1.9.0 (2010/08/01) DB定義DB・シーケンス定義追? 032 * @version 0.9.0 2010/08/01 033 * @author Hiroki Nakamura 034 * @since JDK1.1, 035 */ 036 public class TableFilter_SEQUENCE_HSQLDB extends TableFilter_SEQUENCE { 037 //* こ?プログラ??VERSION??を設定します? {@value} */ 038 private static final String VERSION = "5.1.9.0 (2010/08/01)" ; 039 040 /** 041 * シーケンス作?の処?実行します? 042 * 043 * @param clmNo カラ?号配? 044 * @param data ?行?の??タ配? 045 * 046 * @return シーケンス作? 047 */ 048 @Override 049 protected String makeLineList( final int[] clmNo,final String[] data ) { 050 StringBuilder buf = new StringBuilder(); 051 052 if( isXml ) { buf.append( EXEC_START_TAG ).append( CR ); } 053 054 buf.append( "CREATE SEQUENCE " ).append( data[clmNo[SEQNAME]] ).append( CR ); 055 buf.append( " AS INTEGER" ); 056 buf.append( " START WITH " ).append( data[clmNo[STARTVAL]] ); 057 buf.append( " INCREMENT BY " ).append( data[clmNo[INCREBY]] ); 058 059 if( isXml ) { buf.append( CR ).append( EXEC_END_TAG ); } 060 else { buf.append( " ;" ); } 061 062 return buf.toString(); 063 } 064 }