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 */
016package org.opengion.plugin.table;
017
018import java.util.Locale;                                                                                        // 7.2.9.4 (2020/11/20)
019
020/**
021 * TableFilter_INDEX_POSTGRES は、TableUpda インターフェースを継承した、DBTableModel 処理用の
022 * 実装クラスです。とくに、PostgreSQL用のインデックス作成スクリプトを作成します。
023 *
024 * ここでは、テーブル一覧の検索結果より、GF07 のインデックスカラム定義テーブルから
025 * 必要な情報を取得し、テーブル作成スクリプトを作成します。
026 * 出力ファイルは、テーブル名+"I.sql" という命名規則で作成します。
027 * 検索では、(SYSTEM_ID,TBLSYU,TABLE_NAME,TABLE_LABEL,INDEX_NAME,NAME_JA,INDTYPE,TABLESPACE_NAME,INITIAL_EXTENT)
028 * の項目を取得する必要があります。
029 *
030 * @og.rev 4.0.0.0 (2005/08/31) 新規作成
031 * @og.rev 6.5.0.0 (2016/09/30) クラス名変更(TableFilter_INDEX_POSGRE → TableFilter_INDEX_POSTGRES)
032 *
033 * @version  6.5.0  2000/10/17
034 * @author   Kazuhiko Hasegawa
035 * @since    JDK1.8,
036 */
037public class TableFilter_INDEX_POSTGRES extends TableFilter_INDEX {
038        /** このプログラムのVERSION文字列を設定します。   {@value} */
039        private static final String VERSION = "6.5.0.0 (2016/09/30)" ;
040
041        /**
042         * デフォルトコンストラクター
043         *
044         * @og.rev 6.4.2.0 (2016/01/29) PMD refactoring. Each class should declare at least one constructor.
045         * @og.rev 6.5.0.0 (2016/09/30) クラス名変更(TableFilter_INDEX_POSGRE → TableFilter_INDEX_POSTGRES)
046         */
047        public TableFilter_INDEX_POSTGRES() { super(); }                // これも、自動的に呼ばれるが、空のメソッドを作成すると警告されるので、明示的にしておきます。
048        /**
049         * ヘッダー部分の処理を実行します。
050         *
051         * @og.rev 5.10.25.0 (2020/10/02) 先頭にencodingを付加するために作成
052         *
053         * @param       clmNo   カラム番号配列
054         * @param       data    1行分のデータ配列
055         *
056         * @return      ヘッダー部分の文字列
057         */
058        @Override
059        protected String makeHeadLine( final int[] clmNo,final String[] data ) {
060                String str = isXml ? "" : "\\encoding UTF8;" + CR;
061                str += super.makeHeadLine( clmNo,data );
062                return str;
063        }
064
065        /**
066         * インデックス作成の処理を実行します。
067         *
068         * @og.rev 5.10.25.0 (2020/10/02) 小文字化するために追加
069         *
070         * @param       clmNo   カラム番号配列
071         * @param       data    1行分のデータ配列
072         * @param   clms        カラム名(CSV形式)
073         *
074         * @return      作成された1行分の文字列
075         */
076        @Override
077        protected String makeLineList( final int[] clmNo,final String[] data,final String clms ) {
078//              return super.makeLineList( clmNo, data, clms ).toLowerCase();
079                return super.makeLineList( clmNo, data, clms ).toLowerCase( Locale.JAPAN );     // 7.2.9.4 (2020/11/20)
080        }
081
082        /**
083         * 定義の最後の部分の処理を実行します。
084         *
085         * @og.rev 6.0.2.3 (2014/10/10) EXEC_END_TAG を追加。キャッシュします。
086         *
087         * @param       clmNo   カラム番号配列
088         * @param       data    1行分のデータ配列
089         *
090         * @return      定義の最後の部分
091         */
092        @Override
093        protected String makeEndLine( final int[] clmNo,final String[] data ) {
094                return execEndTag ;
095        }
096}