File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\command\dml\SetTypes.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.command.dml;
8
9 import java.util.ArrayList;
10 import org.h2.util.New;
11
12 /**
13 * The list of setting for a SET statement.
14 */
15 public class SetTypes {
16
17 /**
18 * The type of a SET IGNORECASE statement.
19 */
20 public static final int IGNORECASE = 1;
21
22 /**
23 * The type of a SET MAX_LOG_SIZE statement.
24 */
25 public static final int MAX_LOG_SIZE = 2;
26
27 /**
28 * The type of a SET MODE statement.
29 */
30 public static final int MODE = 3;
31
32 /**
33 * The type of a SET READONLY statement.
34 */
35 public static final int READONLY = 4;
36
37 /**
38 * The type of a SET LOCK_TIMEOUT statement.
39 */
40 public static final int LOCK_TIMEOUT = 5;
41
42 /**
43 * The type of a SET DEFAULT_LOCK_TIMEOUT statement.
44 */
45 public static final int DEFAULT_LOCK_TIMEOUT = 6;
46
47 /**
48 * The type of a SET DEFAULT_TABLE_TYPE statement.
49 */
50 public static final int DEFAULT_TABLE_TYPE = 7;
51
52 /**
53 * The type of a SET CACHE_SIZE statement.
54 */
55 public static final int CACHE_SIZE = 8;
56
57 /**
58 * The type of a SET TRACE_LEVEL_SYSTEM_OUT statement.
59 */
60 public static final int TRACE_LEVEL_SYSTEM_OUT = 9;
61
62 /**
63 * The type of a SET TRACE_LEVEL_FILE statement.
64 */
65 public static final int TRACE_LEVEL_FILE = 10;
66
67 /**
68 * The type of a SET TRACE_MAX_FILE_SIZE statement.
69 */
70 public static final int TRACE_MAX_FILE_SIZE = 11;
71
72 /**
73 * The type of a SET COLLATION statement.
74 */
75 public static final int COLLATION = 12;
76
77 /**
78 * The type of a SET CLUSTER statement.
79 */
80 public static final int CLUSTER = 13;
81
82 /**
83 * The type of a SET WRITE_DELAY statement.
84 */
85 public static final int WRITE_DELAY = 14;
86
87 /**
88 * The type of a SET DATABASE_EVENT_LISTENER statement.
89 */
90 public static final int DATABASE_EVENT_LISTENER = 15;
91
92 /**
93 * The type of a SET MAX_MEMORY_ROWS statement.
94 */
95 public static final int MAX_MEMORY_ROWS = 16;
96
97 /**
98 * The type of a SET LOCK_MODE statement.
99 */
100 public static final int LOCK_MODE = 17;
101
102 /**
103 * The type of a SET DB_CLOSE_DELAY statement.
104 */
105 public static final int DB_CLOSE_DELAY = 18;
106
107 /**
108 * The type of a SET LOG statement.
109 */
110 public static final int LOG = 19;
111
112 /**
113 * The type of a SET THROTTLE statement.
114 */
115 public static final int THROTTLE = 20;
116
117 /**
118 * The type of a SET MAX_MEMORY_UNDO statement.
119 */
120 public static final int MAX_MEMORY_UNDO = 21;
121
122 /**
123 * The type of a SET MAX_LENGTH_INPLACE_LOB statement.
124 */
125 public static final int MAX_LENGTH_INPLACE_LOB = 22;
126
127 /**
128 * The type of a SET COMPRESS_LOB statement.
129 */
130 public static final int COMPRESS_LOB = 23;
131
132 /**
133 * The type of a SET ALLOW_LITERALS statement.
134 */
135 public static final int ALLOW_LITERALS = 24;
136
137 /**
138 * The type of a SET MULTI_THREADED statement.
139 */
140 public static final int MULTI_THREADED = 25;
141
142 /**
143 * The type of a SET SCHEMA statement.
144 */
145 public static final int SCHEMA = 26;
146
147 /**
148 * The type of a SET OPTIMIZE_REUSE_RESULTS statement.
149 */
150 public static final int OPTIMIZE_REUSE_RESULTS = 27;
151
152 /**
153 * The type of a SET SCHEMA_SEARCH_PATH statement.
154 */
155 public static final int SCHEMA_SEARCH_PATH = 28;
156
157 /**
158 * The type of a SET UNDO_LOG statement.
159 */
160 public static final int UNDO_LOG = 29;
161
162 /**
163 * The type of a SET REFERENTIAL_INTEGRITY statement.
164 */
165 public static final int REFERENTIAL_INTEGRITY = 30;
166
167 /**
168 * The type of a SET MVCC statement.
169 */
170 public static final int MVCC = 31;
171
172 /**
173 * The type of a SET MAX_OPERATION_MEMORY statement.
174 */
175 public static final int MAX_OPERATION_MEMORY = 32;
176
177 /**
178 * The type of a SET EXCLUSIVE statement.
179 */
180 public static final int EXCLUSIVE = 33;
181
182 /**
183 * The type of a SET CREATE_BUILD statement.
184 */
185 public static final int CREATE_BUILD = 34;
186
187 /**
188 * The type of a SET \@VARIABLE statement.
189 */
190 public static final int VARIABLE = 35;
191
192 /**
193 * The type of a SET QUERY_TIMEOUT statement.
194 */
195 public static final int QUERY_TIMEOUT = 36;
196
197 /**
198 * The type of a SET REDO_LOG_BINARY statement.
199 */
200 public static final int REDO_LOG_BINARY = 37;
201
202 private static final ArrayList<String> TYPES = New.arrayList();
203
204 private SetTypes() {
205 // utility class
206 }
207
208 static {
209 ArrayList<String> list = TYPES;
210 list.add(null);
211 list.add(IGNORECASE, "IGNORECASE");
212 list.add(MAX_LOG_SIZE, "MAX_LOG_SIZE");
213 list.add(MODE, "MODE");
214 list.add(READONLY, "READONLY");
215 list.add(LOCK_TIMEOUT, "LOCK_TIMEOUT");
216 list.add(DEFAULT_LOCK_TIMEOUT, "DEFAULT_LOCK_TIMEOUT");
217 list.add(DEFAULT_TABLE_TYPE, "DEFAULT_TABLE_TYPE");
218 list.add(CACHE_SIZE, "CACHE_SIZE");
219 list.add(TRACE_LEVEL_SYSTEM_OUT, "TRACE_LEVEL_SYSTEM_OUT");
220 list.add(TRACE_LEVEL_FILE, "TRACE_LEVEL_FILE");
221 list.add(TRACE_MAX_FILE_SIZE, "TRACE_MAX_FILE_SIZE");
222 list.add(COLLATION, "COLLATION");
223 list.add(CLUSTER, "CLUSTER");
224 list.add(WRITE_DELAY, "WRITE_DELAY");
225 list.add(DATABASE_EVENT_LISTENER, "DATABASE_EVENT_LISTENER");
226 list.add(MAX_MEMORY_ROWS, "MAX_MEMORY_ROWS");
227 list.add(LOCK_MODE, "LOCK_MODE");
228 list.add(DB_CLOSE_DELAY, "DB_CLOSE_DELAY");
229 list.add(LOG, "LOG");
230 list.add(THROTTLE, "THROTTLE");
231 list.add(MAX_MEMORY_UNDO, "MAX_MEMORY_UNDO");
232 list.add(MAX_LENGTH_INPLACE_LOB, "MAX_LENGTH_INPLACE_LOB");
233 list.add(COMPRESS_LOB, "COMPRESS_LOB");
234 list.add(ALLOW_LITERALS, "ALLOW_LITERALS");
235 list.add(MULTI_THREADED, "MULTI_THREADED");
236 list.add(SCHEMA, "SCHEMA");
237 list.add(OPTIMIZE_REUSE_RESULTS, "OPTIMIZE_REUSE_RESULTS");
238 list.add(SCHEMA_SEARCH_PATH, "SCHEMA_SEARCH_PATH");
239 list.add(UNDO_LOG, "UNDO_LOG");
240 list.add(REFERENTIAL_INTEGRITY, "REFERENTIAL_INTEGRITY");
241 list.add(MVCC, "MVCC");
242 list.add(MAX_OPERATION_MEMORY, "MAX_OPERATION_MEMORY");
243 list.add(EXCLUSIVE, "EXCLUSIVE");
244 list.add(CREATE_BUILD, "CREATE_BUILD");
245 list.add(VARIABLE, "@");
246 list.add(QUERY_TIMEOUT, "QUERY_TIMEOUT");
247 list.add(REDO_LOG_BINARY, "REDO_LOG_BINARY");
248 }
249
250 /**
251 * Get the set type number.
252 *
253 * @param name the set type name
254 * @return the number
255 */
256 public static int getType(String name) {
257 for (int i = 0; i < getTypes().size(); i++) {
258 if (name.equals(getTypes().get(i))) {
259 return i;
260 }
261 }
262 return -1;
263 }
264
265 public static ArrayList<String> getTypes() {
266 return TYPES;
267 }
268
269 /**
270 * Get the set type name.
271 *
272 * @param type the type number
273 * @return the name
274 */
275 public static String getTypeName(int type) {
276 return getTypes().get(type);
277 }
278
279 }
280