001/* 002 * JKNIV, SQLegance keeping queries maintainable. 003 * 004 * Copyright (C) 2017, the original author or authors. 005 * 006 * This library is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 2.1 of the License. 010 * 011 * This library is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with this library; if not, write to the Free Software Foundation, Inc., 018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 019 */ 020package net.sf.jkniv.sqlegance; 021 022/** 023 * 024 * TODO properties to add 025 * add property to remove end line from queries, good for debug 026 * add property to limit parameter at clause IN, default is 1000 for oracle 027 * 028 * 029 * @author Alisson Gomes 030 * @since 0.6.0 031 */ 032public enum RepositoryProperty 033{ 034 035 /** property: <code>user</code>, default value is: <code>null</code> */ 036 JDBC_USER { 037 public String key() { return "user"; } 038 039 public String defaultValue() { return null; } 040 }, 041 042 /** property: <code>password</code>, default value is: <code>null</code> */ 043 JDBC_PASSWORD { 044 public String key() { return "password"; } 045 046 public String defaultValue() { return null; } 047 }, 048 049 /** property: <code>url</code>, default value is: <code>null</code> */ 050 JDBC_URL { 051 public String key() { return "url"; } 052 053 public String defaultValue() { return null; } 054 }, 055 056 /** property: <code>driver</code>, default value is: <code>null</code> */ 057 JDBC_DRIVER { 058 public String key() { return "driver"; } 059 060 public String defaultValue() { return null; } 061 }, 062 063 /** property: <code>schema</code>, default value is: <code>null</code> */ 064 JDBC_SCHEMA { 065 public String key() { return "schema"; } 066 067 public String defaultValue() { return null; } 068 }, 069 070 /* 071 /** property: <code>jkniv.repository.jdbc.stmt_strategy</code>, default value is: <code>null</code>, must be implemented by whinstone-*technology* * 072 PREPARED_STATEMENT_STRATEGY { 073 public String key() { return "jkniv.repository.jdbc.stmt_strategy"; } 074 075 public String defaultValue() { return null; } 076 }, 077 */ 078 079 /** property: <code>jkniv.repository.query_namestrategy</code> */ 080 QUERY_NAME_STRATEGY { 081 public String key() { return PREFIX+".query_namestrategy"; } 082 083 public String defaultValue() { return "net.sf.jkniv.sqlegance.HashQueryNameStrategy"; } 084 }, 085 086 /** property: <code>jkniv.repository.jdbc.dialect</code> */ 087 SQL_DIALECT { 088 public String key() { return PREFIX+".jdbc.dialect"; } 089 090 public String defaultValue() { return "net.sf.jkniv.sqlegance.dialect.AnsiDialect"; } 091 }, 092 093 /** property: <code>jkniv.repository.stats</code> */ 094 SQL_STATS { 095 public String key() { return PREFIX+".stats"; } 096 097 public String defaultValue() { return "false"; } 098 }, 099 100 /** property: <code>jkniv.repository.debug_sql</code> */ 101 DEBUG_SQL { 102 public String key() { return PREFIX+".debug_sql"; } 103 104 public String defaultValue() { return "NONE"; } 105 }, 106 107 /** property: <code>jkniv.repository.data_masking</code> */ 108 DATA_MASKING { 109 public String key() { return PREFIX+".data_masking"; } 110 111 public String defaultValue() { return "net.sf.jkniv.sqlegance.logger.SimpleDataMasking"; } 112 }, 113 114 /** 115 * Enabling (<b>true</b> value) a short name for query <code>id</code>, example: <code>com.acme.queries.<b>updateUser</b></code>, 116 * where <code><b>updateUser</b></code> is a shortcut. 117 * Default is <b>false</b>. 118 * property: <code>jkniv.repository.short_name_enable</code> */ 119 SHORT_NAME_ENABLE { 120 public String key() { return PREFIX+".short_name_enable"; } 121 122 public String defaultValue() { return "false"; } 123 }, 124 125 /** 126 * Enabling (<b>true</b> value) reloadable xml file when change happens 127 * Default is <b>false</b>. 128 * property: <code>jkniv.repository.reloadable_xml_enable</code> */ 129 RELOADABLE_XML_ENABLE { 130 public String key() { return PREFIX+".reloadable_xml_enable"; } 131 132 public String defaultValue() { return "false"; } 133 }, 134 135 /* 136 * Enabling (<b>true</b> value) the package from java project become make the function 137 * from <code>package</code> tag. Default is <b>false</b>. 138 * <code>package</code> tag override the project package. 139 * <br> 140 * property: <code>jkniv.repository.project_package_enable</code> * 141 PROJECT_PACKAGE_ENABLE { 142 public String key() { return "jkniv.repository.project_package_enable"; } 143 144 public String defaultValue() { return "false"; } 145 }, 146 */ 147 148 /** property: <code>jkniv.repository.jdbc_adapter_factory</code>, default value is: <code>null</code> */ 149 JDBC_ADAPTER_FACTORY { 150 public String key() { return PREFIX+".jdbc_adapter_factory"; } 151 152 public String defaultValue() { return null; } 153 }, 154 155 /** property: <code>jkniv.repository.show_config</code> */ 156 SHOW_CONFIG { 157 public String key() { return PREFIX+".show_config"; } 158 159 public String defaultValue() { return "false"; } 160 }, 161 162 163 /** property: <code>jkniv.repository.protocol_version</code> , default value is: <code>V4</code> */ 164 PROTOCOL_VERSION { 165 public String key() { return PREFIX+".protocol_version"; } 166 167 public String defaultValue() { return "V4"; } 168 }, 169 170 /** property: <code>jkniv.repository.accessId</code> */ 171 ACCESS_ID { 172 public String key() { return PREFIX+".accessId"; } 173 174 public String defaultValue() { return "id,getId,setId"; } 175 }, 176 177 /** property: <code>jkniv.repository.key_file</code> , default value is: <code>null</code> */ 178 KEY_FILE { 179 public String key() { return PREFIX+".key_file"; } 180 181 public String defaultValue() { return null; } 182 }, 183 184 /** property: <code>jkniv.cassandra.local_datacenter</code> , default value is: <code>null</code> */ 185 LOCAL_DATACENTER { 186 public String key() { return "jkniv.cassandra.local_datacenter"; } 187 188 public String defaultValue() { return null; } 189 }, 190// /** <code>jkniv.repository.ttl_sql</code> */ 191// TTL_SQL { 192// public String key() { return "jkniv.repository.ttl_sql"; } 193// } 194 ; 195// /** <code>jkniv.repository.ttl_sql</code> */ 196// TTL_SQL { 197// public String key() { return "jkniv.repository.ttl_sql"; } 198// } 199 ; 200 201 public abstract String key(); 202 203 public abstract String defaultValue(); 204 205 public static final String PREFIX = "jkniv.repository"; 206}