Source Code Cross Referenced for Schemes.java in  » Database-ORM » MMBase » org » mmbase » storage » implementation » database » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.storage.implementation.database 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:        This software is OSI Certified Open Source Software.
003:        OSI Certified is a certification mark of the Open Source Initiative.
004:
005:        The license (Mozilla version 1.0) can be read at the MMBase site.
006:        See http://www.MMBase.org/license
007:
008:         */
009:        package org.mmbase.storage.implementation.database;
010:
011:        /**
012:         * This class defines the scheme names and defaults used by the default database storage manager classes.
013:         * Specific storage managers may add their own schemes, or not use schemes at all.
014:         *
015:         * @author Pierre van Rooden
016:         * @since MMBase-1.7
017:         * @version $Id: Schemes.java,v 1.21 2006/04/06 17:40:20 pierre Exp $
018:         */
019:        public final class Schemes {
020:
021:            /**
022:             *  Name of the scheme for creating a row type.
023:             *  The parameters accepted are:
024:             *  <lu>
025:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
026:             *    <li>{1} the builder to create the row type for</li>
027:             *    <li>{2} the field definitions (excluding index definitions)</li>
028:             *    <li>{3} the builder that this rowtype extends from</li>
029:             *  </ul>
030:             *
031:             * This attribute is optional, and there is no default for this scheme.
032:             * An example (for Informix):
033:             * <p>
034:             *  <code> CREATE ROW TYPE {1}_t ({2}) EXTENDS {3}_t </code>
035:             * </p>
036:             */
037:            public static final String CREATE_ROW_TYPE = "create-rowtype-scheme";
038:
039:            /**
040:             *  Name of the scheme for creating a table.
041:             *  The parameters accepted are:
042:             *  <lu>
043:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
044:             *    <li>{1} the table name of the builder to create the table for</li>
045:             *    <li>{2} the field definitions (excluding simple index definitions)</li>
046:             *    <li>{3} the simple index definitions.
047:             *            A comma-seperated list, which is preceded by a comma UNLESS there is a rowtype scheme defined</li>
048:             *    <li>{4} the field definitions, including simple index definitions</li>
049:             *    <li>{5} constraint definitions
050:             *            A comma-seperated list, which is preceded by a comma UNLESS there is a rowtype scheme defined,
051:             *            and no other field definitions.</li>
052:             *    <li>{6} the table name of the builder that this table extends from</li>
053:             *    <li>{7} the database name or catalog</li>
054:             *  </ul>
055:             *
056:             * You can set up your scheme to create extended tables (i.e. in Postgresql).
057:             * You also can define indexes or fields seperate (i.e. in HSQL or in a create table after a create row type in Informix)
058:             * or in one go (as you might do with MySQL).
059:             */
060:            public static final String CREATE_TABLE = "create-table-scheme";
061:
062:            /**
063:             *  The default scheme for creating a table.
064:             */
065:            public static final String CREATE_TABLE_DEFAULT = "CREATE TABLE {1} ({4} {5})";
066:
067:            /**
068:             *  Name of the scheme for creating a row type.
069:             *  The parameters accepted are:
070:             *  <lu>
071:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
072:             *    <li>{1} the builder to create the row type for</li>
073:             *    <li>{2} the field definitions (excluding index definitions)</li>
074:             *  </ul>
075:             *
076:             * This attribute is optional, and there is no default for this scheme.
077:             * An example (for Informix):
078:             * <p>
079:             *  <code> CREATE ROW TYPE {1}_t ({2}) </code>
080:             * </p>
081:             */
082:            public static final String CREATE_OBJECT_ROW_TYPE = "create-object-rowtype-scheme";
083:
084:            /**
085:             *  Name of the scheme for creating a table.
086:             *  The parameters accepted are:
087:             *  <lu>
088:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
089:             *    <li>{1} the builder to create the table for</li>
090:             *    <li>{2} the field definitions (excluding simple index definitions)
091:             *            A comma-seperated list, which is preceded by a comma UNLESS there is a rowtype scheme defined</li>
092:             *    <li>{3} the simple index definitions</li>
093:             *    <li>{4} the field definitions, including simple index definitions
094:             *            A comma-seperated list, which is preceded by a comma UNLESS there is a rowtype scheme defined,
095:             *            and no other field definitions.</li>
096:             *    <li>{5} the constraint definitions</li>
097:             *  </ul>
098:             *
099:             * You can set up your scheme to create extended tables (i.e. in Postgresql).
100:             * You also can define indexes or fields seperate (i.e. in HSQL or in a create table after a create row type in Informix)
101:             * or in one go (as you might do with MySQL).
102:             */
103:            public static final String CREATE_OBJECT_TABLE = "create-object-table-scheme";
104:
105:            /**
106:             *  The default scheme for creating a table.
107:             */
108:            public static final String CREATE_OBJECT_TABLE_DEFAULT = "CREATE TABLE {1} ({4} {5})";
109:
110:            /**
111:             *  Name of the partial scheme for creating a primary key.
112:             *  This a partial scheme that is typically included in an CREATE TABLE or ALTER TABLE
113:             *  scheme.
114:             *  The parameters accepted are:
115:             *  <lu>
116:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
117:             *    <li>{1} the builder to create the key for</li>
118:             *    <li>{2} the field to create the key for</li>
119:             *  </ul>
120:             */
121:            public static final String CREATE_PRIMARY_KEY = "create-primary-key-scheme";
122:
123:            /**
124:             *  The default scheme for creating a prinary key.
125:             */
126:            public static final String CREATE_PRIMARY_KEY_DEFAULT = "PRIMARY KEY ({2})";
127:
128:            /**
129:             *  Name of the partial scheme for creating a unique key.
130:             *  The parameters accepted are:
131:             *  <lu>
132:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
133:             *    <li>{1} the builder to create the key for</li>
134:             *    <li>{2} the field to create the key for</li>
135:             *  </ul>
136:             */
137:            public static final String CREATE_UNIQUE_KEY = "create-unique-key-scheme";
138:
139:            /**
140:             *  The default scheme for selecting a node type.
141:             */
142:            public static final String CREATE_UNIQUE_KEY_DEFAULT = "CONSTRAINT {1}_{2} UNIQUE ({2})";
143:
144:            /**
145:             *  Name of the partial scheme for creating a foreign (referential) key.
146:             *  This a partial scheme that is typically included in an CREATE TABLE or ALTER TABLE
147:             *  scheme.
148:             *  The parameters accepted are:
149:             *  <lu>
150:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
151:             *    <li>{1} the builder to create the key for</li>
152:             *    <li>{2} the field to create the key for</li>
153:             *    <li>{3} the basic storage element referenced (name of the object table)</li>
154:             *    <li>{4} the name of the number field</li>
155:             *    <li>{5} the name of the foreign key (may be unspecified)</li>
156:             *  </ul>
157:             */
158:            public static final String CREATE_FOREIGN_KEY = "create-foreign-key-scheme";
159:
160:            /**
161:             *  The default scheme for selecting a node type.
162:             */
163:            public static final String CREATE_FOREIGN_KEY_DEFAULT = "CONSTRAINT {1}_{2}_foreign FOREIGN KEY ({2}) REFERENCES {3} ({4})";
164:
165:            /**
166:             *  Name of the scheme for creating a unique (generally composite) index.
167:             *  The parameters accepted are:
168:             *  <lu>
169:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
170:             *    <li>{1} the builder to create the key for</li>
171:             *    <li>{2} the fieldlist to create the key for</li>
172:             *    <li>{3} the index name</li>
173:             *  </ul>
174:             */
175:            public static final String CREATE_UNIQUE_INDEX = "create-unique-index-scheme";
176:
177:            /**
178:             *  The default scheme for creating a composite key.
179:             */
180:            public static final String CREATE_UNIQUE_INDEX_DEFAULT = "ALTER TABLE {1} ADD CONSTRAINT {3} UNIQUE ({2})";
181:
182:            /**
183:             *  Name of the scheme for deleting a unique (generally composite) index.
184:             *  The parameters accepted are:
185:             *  <lu>
186:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
187:             *    <li>{1} the builder of the field</li>
188:             *    <li>{2} the index name</li>
189:             *  </ul>
190:             */
191:            public static final String DELETE_UNIQUE_INDEX = "delete-unique-index-scheme";
192:
193:            /**
194:             *  The default scheme for deleting a constraint.
195:             */
196:            public static final String DELETE_UNIQUE_INDEX_DEFAULT = "ALTER TABLE {1} DROP CONSTRAINT {2}";
197:
198:            /**
199:             *  Name of the scheme for creating an index for a field.
200:             *  The parameters accepted are:
201:             *  <lu>
202:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
203:             *    <li>{1} the builder to create the key for</li>
204:             *    <li>{2} the field (or fieldlist) to create the key for</li>
205:             *    <li>{3} the index name</li>
206:             *  </ul>
207:             */
208:            public static final String CREATE_INDEX = "create-index-scheme";
209:
210:            /**
211:             *  The default scheme for creating an index
212:             */
213:            public static final String CREATE_INDEX_DEFAULT = null;
214:
215:            /**
216:             *  Name of the scheme for deleting a index.
217:             *  The parameters accepted are:
218:             *  <lu>
219:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
220:             *    <li>{1} the builder of the field</li>
221:             *    <li>{2} the index name</li>
222:             *  </ul>
223:             */
224:            public static final String DELETE_INDEX = "delete-index-scheme";
225:
226:            /**
227:             *  The default scheme for deleting a constraint.
228:             */
229:            public static final String DELETE_INDEX_DEFAULT = null;
230:
231:            /**
232:             *  Name of the scheme for selecting a node type.
233:             *  The parameters accepted are:
234:             *  <lu>
235:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
236:             *    <li>{1} the builder to delete the node from (MMObjectBuilder), or the builder table name (String)</li>
237:             *    <li>{2} the 'number' field (CoreField), or the database field name (String)</li>
238:             *    <li>{3} the number of the object to update (Integer)</li>
239:             *  </ul>
240:             */
241:            public static final String DELETE_NODE = "delete-node-scheme";
242:
243:            /**
244:             *  The default scheme for selecting a node type.
245:             */
246:            public static final String DELETE_NODE_DEFAULT = "DELETE FROM {1} WHERE {2} = {3,number,##########}";
247:
248:            /**
249:             *  Name of the scheme for dropping a row type.
250:             *  The parameters accepted are:
251:             *  <lu>
252:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
253:             *    <li>{1} the builder to drop teh rowtype of (MMObjectBuilder), or the builder table name (String)</li>
254:             *  </ul>
255:             */
256:            public static final String DROP_ROW_TYPE = "drop-rowtype-scheme";
257:
258:            /**
259:             *  Name of the scheme for dropping a table.
260:             *  The parameters accepted are:
261:             *  <lu>
262:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
263:             *    <li>{1} the builder to drop (MMObjectBuilder), or the builder table name (String)</li>
264:             *  </ul>
265:             */
266:            public static final String DROP_TABLE = "drop-table-scheme";
267:
268:            /**
269:             *  The default scheme for reading a text field.
270:             */
271:            public static final String DROP_TABLE_DEFAULT = "DROP TABLE {1}";
272:
273:            /**
274:             *  Name of the scheme for reading a binary field from a node.
275:             *  The parameters accepted are:
276:             *  <lu>
277:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
278:             *    <li>{1} the builder to delete the node from (MMObjectBuilder), or the builder table name (String)</li>
279:             *    <li>{2} the binary field (CoreField), or the binary field name (String)</li>
280:             *    <li>{3} the 'number' field (CoreField), or the database field name (String)</li>
281:             *    <li>{4} the number of the object to update (Integer)</li>
282:             *  </ul>
283:             */
284:            public static final String GET_BINARY_DATA = "get-binary-data-scheme";
285:
286:            /**
287:             *  The default scheme for reading a binary field.
288:             */
289:            public static final String GET_BINARY_DATA_DEFAULT = "SELECT {2} FROM {1} WHERE {3} = {4,number,##########}";
290:
291:            /**
292:             *  Name of the scheme for obtaining the size of a (builder) table.
293:             *  The parameters accepted are:
294:             *  <lu>
295:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
296:             *    <li>{1} the builder to count the node of (MMObjectBuilder), or the builder table name (String)</li>
297:             *  </ul>
298:             */
299:            public static final String GET_TABLE_SIZE = "get-table-size-scheme";
300:
301:            /**
302:             *  The default scheme for reading a text field.
303:             */
304:            public static final String GET_TABLE_SIZE_DEFAULT = "SELECT count(*) FROM {1}";
305:
306:            /**
307:             *  Name of the scheme for reading a text field from a node.
308:             *  The parameters accepted are:
309:             *  <lu>
310:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
311:             *    <li>{1} the builder to delete the node from (MMObjectBuilder), or the builder table name (String)</li>
312:             *    <li>{2} the text field (CoreField), or the text field name (String)</li>
313:             *    <li>{3} the 'number' field (CoreField), or the database field name (String)</li>
314:             *    <li>{4} the number of the object to update (Integer)</li>
315:             *  </ul>
316:             */
317:            public static final String GET_TEXT_DATA = "get-text-data-scheme";
318:
319:            /**
320:             *  The default scheme for reading a text field.
321:             */
322:            public static final String GET_TEXT_DATA_DEFAULT = "SELECT {2} FROM {1} WHERE {3} = {4,number,##########}";
323:
324:            /**
325:             *  Name of the scheme for inserting a node.
326:             *  The parameters accepted are:
327:             *  <lu>
328:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
329:             *    <li>{1} the builder to update (MMObjectBuilder), or the builder table name (String)</li>
330:             *    <li>{2} A comma-separated list of fieldnames to update'</li>
331:             *    <li>{3} A comma-separated list of value-placeholders to update (a value placehodler takes the format '?')</li>
332:             *  </ul>
333:             */
334:            public static final String INSERT_NODE = "insert-node-scheme";
335:
336:            /**
337:             *  The default scheme for inserting a node type.
338:             */
339:            public static final String INSERT_NODE_DEFAULT = "INSERT INTO {1} ({2}) VALUES ({3})";
340:
341:            /**
342:             *  Name of the scheme for selecting a node.
343:             *  The parameters accepted are:
344:             *  <lu>
345:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
346:             *    <li>{1} the builder to query (MMObjectBuilder), or the builder table name (String)</li>
347:             *    <li>{2} the 'number' field (CoreField), or the database field name (String)</li>
348:             *    <li>{3} the number to locate (Integer)</li>
349:             *  </ul>
350:             */
351:            public static final String SELECT_NODE = "select-node-scheme";
352:
353:            /**
354:             *  The default scheme for selecting a node.
355:             */
356:            public static final String SELECT_NODE_DEFAULT = "SELECT {2} FROM {1} WHERE {3} = {4,number,##########}";
357:
358:            /**
359:             *  Name of the scheme for selecting a node type.
360:             *  The parameters accepted are:
361:             *  <lu>
362:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
363:             *    <li>{1} the MMBase module (MMBase), or the object table name (String)</li>
364:             *    <li>{2} the 'number' field (CoreField), or the database field name (String)</li>
365:             *    <li>{3} the number to locate (Integer)</li>
366:             *  </ul>
367:             */
368:            public static final String SELECT_NODE_TYPE = "select-nodetype-scheme";
369:
370:            /**
371:             *  The default scheme for selecting a node type.
372:             */
373:            public static final String SELECT_NODE_TYPE_DEFAULT = "SELECT otype FROM {1} WHERE {2} = {3,number,##########}";
374:
375:            /**
376:             *  Name of the scheme for updating a node type.
377:             *  The parameters accepted are:
378:             *  <lu>
379:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
380:             *    <li>{1} the builder to update (MMObjectBuilder), or the builder table name (String)</li>
381:             *    <li>{2} A comma-separated list of fields to update, in the format 'fieldname = ?'</li>
382:             *    <li>{3} the 'number' field (CoreField), or the database field name (String)</li>
383:             *    <li>{4} the number of the object to update (Integer)</li>
384:             *  </ul>
385:             */
386:            public static final String UPDATE_NODE = "update-node-scheme";
387:
388:            /**
389:             *  The default scheme for updating a node type.
390:             */
391:            public static final String UPDATE_NODE_DEFAULT = "UPDATE {1} SET {2} WHERE {3} = {4,number,##########}";
392:
393:            /**
394:             *  Name of the scheme for creating a sequence or number table
395:             *  The parameters accepted are:
396:             *  <lu>
397:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
398:             *    <li>{1} the (suggested) field definition of the primary key field ('number') </li>
399:             *    <li>{2} the database name or catalog</li>
400:             *  </ul>
401:             */
402:            public static final String CREATE_SEQUENCE = "create-sequence-scheme";
403:
404:            /**
405:             *  The default scheme for creating a sequence table.
406:             */
407:            public static final String CREATE_SEQUENCE_DEFAULT = "CREATE TABLE {0}_numberTable ({1})";
408:
409:            /**
410:             *  Name of the scheme for initializing a sequence or number table
411:             *  The parameters accepted are:
412:             *  <lu>
413:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
414:             *    <li>{1} the (suggested) name of the primary key field ('number') </li>
415:             *    <li>{2} the value to init the sequence to </li>
416:             *    <li>{3} a default 'increment'</li>
417:             *  </ul>
418:             */
419:            public static final String INIT_SEQUENCE = "init-sequence-scheme";
420:
421:            /**
422:             *  The default scheme for initializing a sequence table.
423:             */
424:            public static final String INIT_SEQUENCE_DEFAULT = "INSERT INTO {0}_numberTable ({1}) VALUES ({2,number,##########})";
425:
426:            /**
427:             *  Name of the scheme for updating a sequence or number table
428:             *  The parameters accepted are:
429:             *  <lu>
430:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
431:             *    <li>{1} the (suggested) name of the primary key field ('number') </li>
432:             *    <li>{2} the sequence buffer size (nr of keys that MMBase caches in the storage layer). </li>
433:             *  </ul>
434:             */
435:            public static final String UPDATE_SEQUENCE = "update-sequence-scheme";
436:
437:            /**
438:             *  The default scheme for updating a sequence table.
439:             */
440:            public static final String UPDATE_SEQUENCE_DEFAULT = "UPDATE {0}_numberTable SET {1} = {1} + {2}";
441:
442:            /**
443:             *  Name of the scheme for retrieving the key from sequence or number table
444:             *  The parameters accepted are:
445:             *  <lu>
446:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
447:             *    <li>{1} the (suggested) name of the primary key field ('number') </li>
448:             *    <li>{2} the sequence buffer size (nr of keys that MMBase caches in the storage layer). </li>
449:             *  </ul>
450:             */
451:            public static final String READ_SEQUENCE = "read-sequence-scheme";
452:
453:            /**
454:             *  The default scheme for retrieving the key from a sequence table.
455:             */
456:            public static final String READ_SEQUENCE_DEFAULT = "SELECT {1} FROM {0}_numberTable";
457:
458:            /**
459:             *  Name of the scheme for creating (adding) a field.
460:             *  The parameters accepted are:
461:             *  <lu>
462:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
463:             *    <li>{1} the builder of the field</li>
464:             *    <li>{2} the field name</li>
465:             *    <li>{3} the field definition (excluding simple index definitions)</li>
466:             *  </ul>
467:             */
468:            public static final String CREATE_FIELD = "create-field-scheme";
469:
470:            /**
471:             *  The default scheme for creating (adding) a field.
472:             */
473:            public static final String CREATE_FIELD_DEFAULT = "ALTER TABLE {1} ADD COLUMN {2} {3}";
474:
475:            /**
476:             *  Name of the scheme for changing a field.
477:             *  The parameters accepted are:
478:             *  <lu>
479:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
480:             *    <li>{1} the builder of the field</li>
481:             *    <li>{2} the field name</li>
482:             *    <li>{3} the field definition (excluding simple index definitions)</li>
483:             *  </ul>
484:             */
485:            public static final String CHANGE_FIELD = "change-field-scheme";
486:
487:            /**
488:             *  The default scheme for changing a field.
489:             */
490:            public static final String CHANGE_FIELD_DEFAULT = "ALTER TABLE {1} MODIFY COLUMN {2} {3}";
491:
492:            /**
493:             *  Name of the scheme for deleting a field.
494:             *  The parameters accepted are:
495:             *  <lu>
496:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
497:             *    <li>{1} the builder of the field</li>
498:             *    <li>{2} the field</li>
499:             *  </ul>
500:             */
501:            public static final String DELETE_FIELD = "delete-field-scheme";
502:
503:            /**
504:             *  The default scheme for deleting a field.
505:             */
506:            public static final String DELETE_FIELD_DEFAULT = "ALTER TABLE {1} DROP COLUMN {2}";
507:
508:            /**
509:             *  Name of the scheme for creating (adding) a constraint, such as a key or index.
510:             *  The parameters accepted are:
511:             *  <lu>
512:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
513:             *    <li>{1} the builder of the field</li>
514:             *    <li>{2} the constraint definition</li>
515:             *  </ul>
516:             */
517:            public static final String CREATE_CONSTRAINT = "create-constraint-scheme";
518:
519:            /**
520:             *  The default scheme for creating (adding) a constraint.
521:             */
522:            public static final String CREATE_CONSTRAINT_DEFAULT = "ALTER TABLE {1} ADD {2}";
523:
524:            /**
525:             *  Name of the scheme for deleting a constraint, such as a key or index.
526:             *  The parameters accepted are:
527:             *  <lu>
528:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
529:             *    <li>{1} the builder of the field</li>
530:             *    <li>{2} the constraint name</li>
531:             *  </ul>
532:             */
533:            public static final String DELETE_CONSTRAINT = "delete-constraint-scheme";
534:
535:            /**
536:             *  The default scheme for deleting a constraint.
537:             */
538:            public static final String DELETE_CONSTRAINT_DEFAULT = "ALTER TABLE {1} DROP CONSTRAINT {2}";
539:
540:            /**
541:             *  Name of the scheme for creating a view.
542:             *  The parameters accepted are:
543:             *  <lu>
544:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
545:             *    <li>{1} the view name of the builder to create the view for</li>
546:             *    <li>{2} the table name of the builder to create the view for</li>
547:             *    <li>{3} the fields in view</li>
548:             *    <li>{4} the fields from tables</li>
549:             *    <li>{5} the number field</li>
550:             *    <li>{6} the table name of the builder that this table extends from</li>
551:             *    <li>{7} the database name or catalog</li>
552:             *  </ul>
553:             */
554:            public static final String CREATE_VIEW = "create-view-scheme";
555:            public static final String CREATE_VIEW_DEFAULT = "CREATE OR REPLACE VIEW {1} {{3}} AS "
556:                    + "SELECT {4} FROM {2} WHERE {2}.{5} = {6}.{5}";
557:
558:            /**
559:             *  Name of the scheme for creating an 'insert' trigger for a view.
560:             *  The parameters accepted are:
561:             *  <ul>
562:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
563:             *    <li>{1} the name of the view to create the trigger on</li>
564:             *    <li>{2} the name of the table in which the fields for this view are stored</li>
565:             *    <li>{3} the name of the view/table that this builder extends from</li>
566:             *    <li>{4} the list of fields of the table {2}</li>
567:             *    <li>{5} the list of values of the table {2}</li>
568:             *    <li>{6} the list of fields of the view {3}</li>
569:             *    <li>{7} the list of values of the table {3}</li>
570:             *    <li>{8} the name of the trigger</li>
571:             *  </ul>
572:             */
573:            public static final String CREATE_INSERT_TRIGGER = "create-insert-trigger-scheme";
574:            public static final String CREATE_INSERT_TRIGGER_DEFAULT = null;
575:
576:            /**
577:             *  Name of the scheme for creating an 'delete' trigger for a view.
578:             *  The parameters accepted are:
579:             *  <ul>
580:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
581:             *    <li>{1} the name of the view to create the trigger on</li>
582:             *    <li>{2} the name of the table in which the fields for this view are stored</li>
583:             *    <li>{3} the name of the view/table that this builder exntends from</li>
584:             *    <li>{4} the name of the number field that joins the tables in the views</li>
585:             *    <li>{5} the name of the trigger</li>
586:             *  </ul>
587:             */
588:            public static final String CREATE_DELETE_TRIGGER = "create-delete-trigger-scheme";
589:            public static final String CREATE_DELETE_TRIGGER_DEFAULT = null;
590:
591:            /**
592:             *  Name of the scheme for creating an 'update' trigger for a view.
593:             *  The parameters accepted are:
594:             *  <ul>
595:             *    <li>{0} the storage manager (StorageManager), or the basename for tables (String)</li>
596:             *    <li>{1} the name of the view to create the trigger on</li>
597:             *    <li>{2} the name of the table in which the fields for this view are stored</li>
598:             *    <li>{3} the name of the view/table that this builder extends from</li>
599:             *    <li>{4} the list 'SET' statements for table {2}</li>
600:             *    <li>{5} the list 'SET' statements for table {3}</li>
601:             *    <li>{6} the name of the number field that joins the tables in the views</li>
602:             *    <li>{7} the name of the trigger</li>
603:             *  </ul>
604:             */
605:            public static final String CREATE_UPDATE_TRIGGER = "create-update-trigger-scheme";
606:            public static final String CREATE_UPDATE_TRIGGER_DEFAULT = null;
607:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.