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.calendar; 017 018import org.opengion.hayabusa.resource.CalendarQuery; 019import org.opengion.fukurou.util.StringUtil; 020 021/** 022 * カレンダDB(GE13)ã®æ¤œç´¢QUERYを定義ã—ãŸã‚¯ãƒ©ã‚¹ã§ã™ã€‚ 023 * 024 * QUERY ã¯ã€ã“ã®ã‚ªãƒ–ジェクトをã€toString() ã—ã¦æ±‚ã‚ã‚‹ã“ã¨ã¨ã—ã¾ã™ã€‚ 025 * 本æ¥ã¯ã€ã“れらã®ã‚¯ãƒ©ã‚¹ã®å…±é€šã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’作æˆã—ã¦ã€getQuery() ãªã©ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’ 026 * 介ã—ã¦å–å¾—ã™ã¹ãã§ã™ãŒã€Object ã®å…±é€šã‚¯ãƒ©ã‚¹ã‚’利用ã™ã‚‹ã“ã¨ã¨ã—ã¾ã™ã€‚ 027 * 028 * @og.rev 3.6.0.0 (2004/09/17) æ–°è¦ä½œæˆ 029 * @og.group ãƒªã‚½ãƒ¼ã‚¹ç®¡ç† 030 * 031 * @version 4.0 032 * @author Kazuhiko Hasegawa 033 * @since JDK5.0, 034 */ 035public final class CalendarQuery_GE13 implements CalendarQuery { 036 /** ã“ã®ãƒ—ãƒã‚°ãƒ©ãƒ ã®VERSIONæ–‡å—列をè¨å®šã—ã¾ã™ã€‚ {@value} */ 037 private static final String VERSION = "6.9.9.3 (2018/09/25)" ; 038 039 /** カレンダDBã®èªã¿è¾¼ã¿ã®ã‚¯ã‚¨ãƒªãƒ¼(GE13) {@value} */ 040 public static final String QUERY = 041 "select YYYYMM,DY1,DY2,DY3,DY4,DY5,DY6,DY7,DY8,DY9,DY10," 042 + "DY11,DY12,DY13,DY14,DY15,DY16,DY17,DY18,DY19,DY20," 043 + "DY21,DY22,DY23,DY24,DY25,DY26,DY27,DY28,DY29,DY30,DY31" 044 + " from GE13 where CDJGS=? and FGJ='1'" 045 + " order by YYYYMM" ; 046 047 /** CDJGS:事æ¥æ‰€ã‚³ãƒ¼ãƒ‰ ã®åˆæœŸå€¤:{@value} */ 048 public static final String DEFAULT_CDJGS = "SYS"; 049 050 /** 051 * デフォルトコンストラクター 052 * 053 * @og.rev 6.4.2.0 (2016/01/29) PMD refactoring. Each class should declare at least one constructor. 054 */ 055 public CalendarQuery_GE13() { super(); } // ã“れもã€è‡ªå‹•çš„ã«å‘¼ã°ã‚Œã‚‹ãŒã€ç©ºã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’作æˆã™ã‚‹ã¨è¦å‘Šã•ã‚Œã‚‹ã®ã§ã€æ˜Žç¤ºçš„ã«ã—ã¦ãŠãã¾ã™ã€‚ 056 057 /** 058 * ï¼”ã¤ã®å¼•æ•°ã‚’å—ã‘å–ã‚Šã€æ•´åˆæ€§ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã„ã¾ã™ã€‚ 059 * 引数ã¯ã€å„クラスã«ã‚ˆã£ã¦ä½¿ç”¨ã™ã‚‹ã‚«ãƒ©ãƒ å(æ„味)ãŒç•°ãªã‚Šã¾ã™ã€‚ 060 * ã¾ãŸã€ã™ã¹ã¦ã®å¼•æ•°ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ã®ã§ã¯ãªãã€ã‚¯ãƒ©ã‚¹æ¯Žã«ã€ãƒã‚§ãƒƒã‚¯ã™ã‚‹ 061 * カラムã®æ•°ã¯ã€ç•°ãªã‚Šã¾ã™ã€‚ 062 * 063 * @og.rev 6.9.9.3 (2018/09/25) å¯å¤‰å¼•æ•°ã«å¤‰æ›´ã—ã¾ã™(PMD Rather than using a lot of String arguments, consider using a container object for those values.)。 064 * 065 * @param args データベース検索時ã®å¼•æ•°( CDJGS:事æ¥æ‰€ã‚³ãƒ¼ãƒ‰ ã®ã¿) 066// * @param arg1 データベース検索時ã®ç¬¬ï¼‘引数(CDJGS:事æ¥æ‰€ã‚³ãƒ¼ãƒ‰) 067// * @param arg2 データベース検索時ã®ç¬¬ï¼’引数(未使用) 068// * @param arg3 データベース検索時ã®ç¬¬ï¼“引数(未使用) 069// * @param arg4 データベース検索時ã®ç¬¬ï¼”引数(未使用) 070 * 071 * @return 入力パラメータã«å¿œã˜ãŸé…列文å—列(CDJGS:事æ¥æ‰€ã‚³ãƒ¼ãƒ‰) 072 * @og.rtnNotNull 073 */ 074// public String[] checkArgment( final String arg1,final String arg2,final String arg3,final String arg4 ) { 075// final String cdjgs = StringUtil.nval( arg1,DEFAULT_CDJGS ); 076 @Override // CalendarQuery 077 public String[] checkArgment( final String... args ) { 078 final String cdjgs = args == null || args.length == 0 ? DEFAULT_CDJGS : StringUtil.nval( args[0],DEFAULT_CDJGS ); 079 return new String[] { cdjgs } ; 080 } 081 082 /** 083 * データベース検索ã®ç‚ºã® Select 文を返ã—ã¾ã™ã€‚ 084 * 引数リストã¨ã¨ã‚‚ã«ã€ä½¿ç”¨ã—ã¾ã™ã€‚ 085 * 086 * @return データベース検索ã®ç‚ºã® Select æ–‡ 087 * @og.rtnNotNull 088 */ 089 @Override // CalendarQuery 090 public String getQuery() { 091 return QUERY; 092 } 093 094 /** 095 * データベースã®æŒã¡æ–¹ã‚’指定ã—ã¾ã™ã€‚ 096 * æŒã¡æ–¹ãŒãƒ•ãƒ©ãƒƒãƒˆ(横æŒã¡=1~31ã®æ—¥ä»˜ã‚’カラムã§æŒã¤)ã®å ´åˆã€trueã‚’è¿”ã—ã¾ã™ã€‚ 097 * 縦æŒã¡(日付å˜ä½ã§ã€è¡Œæƒ…å ±ã¨ã—ã¦æŒã¤)å ´åˆã¯ã€false ã§ã™ã€‚ 098 * 099 * @return DBã®æŒã¡æ–¹ãŒãƒ•ãƒ©ãƒƒãƒˆ(横æŒã¡=1~31ã®æ—¥ä»˜ã‚’カラムã§æŒã¤)ã®å ´åˆã€true 100 * 101 */ 102 @Override // CalendarQuery 103 public boolean isFlatTable() { 104 return true; 105 } 106}