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 }