001: /*
002: * Copyright 2006 Le Duc Bao, Ralf Joachim
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License. You may obtain a copy of
006: * 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, WITHOUT
012: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013: * License for the specific language governing permissions and limitations under
014: * the License.
015: */
016: package org.castor.ddlgen;
017:
018: /**
019: * Handle the configuration for DDL generator.
020: *
021: * @author <a href="mailto:leducbao AT gmail DOT com">Le Duc Bao</a>
022: * @author <a href="mailto:ralf DOT joachim AT syscon DOT eu">Ralf Joachim</a>
023: * @version $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
024: * @since 1.1
025: */
026: public final class DDLGenConfiguration extends Configuration {
027: //--------------------------------------------------------------------------
028:
029: /** Default value for newline at generated DDL. */
030: public static final String DEFAULT_NEWLINE = System
031: .getProperty("line.separator");
032:
033: /** Default indention at generated DDL. */
034: public static final String DEFAULT_INDENT = " ";
035:
036: /** Default value for field delimiter at generated DDL. */
037: public static final String DEFAULT_FIELD_DELIMITER = ",";
038:
039: /** Default value for statement delimiter at generated DDL. */
040: public static final String DEFAULT_STATEMENT_DELIMITER = ";";
041:
042: //--------------------------------------------------------------------------
043: // Global configuration keys
044:
045: /** Generator classes of supported database engines. */
046: public static final String GENERATORS_KEY = "org.castor.ddlgen.Generators";
047:
048: /** Default database engine. */
049: public static final String DEFAULT_ENGINE_KEY = "org.castor.ddlgen.DefaultEngine";
050:
051: /** Schema name. */
052: public static final String SCHEMA_NAME_KEY = "org.castor.ddlgen.SchemaName";
053:
054: /** How to group generated DDL statements? Supported values are TABLE and DDLTYPE. */
055: public static final String GROUP_DDL_KEY = "org.castor.ddlgen.GroupStatements";
056:
057: /** Group ddl by table. */
058: public static final String GROUP_DDL_BY_TABLE = "TABLE";
059:
060: /** Group ddl by ddltype. */
061: public static final String GROUP_DDL_BY_DDLTYPE = "DDLTYPE";
062:
063: /** How to format characters of generated DDL statements? Supported values are
064: * SENSITIVE, UPPER and LOWER. */
065: public static final String CHAR_FORMAT_KEY = "org.castor.ddlgen.CharFormat";
066:
067: /** Do not format characters. */
068: public static final String CHAR_FORMAT_SENSITIVE = "SENSITIVE";
069:
070: /** Convert characters to upper case. */
071: public static final String CHAR_FORMAT_UPPER = "UPPER";
072:
073: /** Convert characters to lower case. */
074: public static final String CHAR_FORMAT_LOWER = "LOWER";
075:
076: /** Newline. */
077: public static final String NEWLINE_KEY = "org.castor.ddlgen.Newline";
078:
079: /** Indention. */
080: public static final String INDENT_KEY = "org.castor.ddlgen.Indention";
081:
082: /** Generate DDL for CREATE statement. */
083: public static final String GENERATE_DDL_FOR_SCHEMA_KEY = "org.castor.ddlgen.GenerateSchema";
084:
085: /** Generate DDL for DROP statement. */
086: public static final String GENERATE_DDL_FOR_DROP_KEY = "org.castor.ddlgen.GenerateDrop";
087:
088: /** Generate DDL for CREATE statement. */
089: public static final String GENERATE_DDL_FOR_CREATE_KEY = "org.castor.ddlgen.GenerateCreate";
090:
091: /** Generate DDL for PRIMARY KEY statement. */
092: public static final String GENERATE_DDL_FOR_PRIMARYKEY_KEY = "org.castor.ddlgen.GeneratePrimaryKey";
093:
094: /** Generate DDL for FOREIGN KEY statement. */
095: public static final String GENERATE_DDL_FOR_FOREIRNKEY_KEY = "org.castor.ddlgen.GenerateForeignKey";
096:
097: /** Generate DDL for INDEX statement. */
098: public static final String GENERATE_DDL_FOR_INDEX_KEY = "org.castor.ddlgen.GenerateIndex";
099:
100: /** Generate DDL for KEY GENERATOR statement. */
101: public static final String GENERATE_DDL_FOR_KEYGENERATOR_KEY = "org.castor.ddlgen.GenerateKeyGenerator";
102:
103: //--------------------------------------------------------------------------
104: // Database specific configuration keys
105:
106: /** Key generator factory classes of supported database engines. */
107: public static final String KEYGEN_FACTORIES_KEY = "org.castor.ddlgen.KeyGeneratorFactories";
108:
109: /** Header comment. */
110: public static final String HEADER_COMMENT_KEY = "org.castor.ddlgen.HeaderComment";
111:
112: /** Trigger template. */
113: public static final String TRIGGER_TEMPLATE_KEY = "org.castor.ddlgen.TriggerTemplate";
114:
115: /** MySQL storage engine is one of MYISAM, InnoDB, MERGE, MEMORY, BDB, ISAM
116: * or null for default. */
117: public static final String STORAGE_ENGINE_KEY = "org.castor.ddlgen.engine.mysql.StorageEngine";
118:
119: /** MySQL delete strategy for foreign keys, one of the CASCADE, RESTRICT,
120: * SET NULL, NO ACTION. Default is NO ACTION. */
121: public static final String FOREIGN_KEY_ON_DELETE_KEY = "org.castor.ddlgen.engine.mysql.ForeignKeyOnDeleteStrategy";
122:
123: /** MySQL update strategy for foreign keys, one of the CASCADE, RESTRICT,
124: * SET NULL, NO ACTION. Default is NO ACTION. */
125: public static final String FOREIGN_KEY_ON_UPDATE_KEY = "org.castor.ddlgen.engine.mysql.ForeignKeyOnUpdateStrategy";
126:
127: //--------------------------------------------------------------------------
128:
129: /**
130: * Constructor for DDLGenConfiguration.
131: */
132: public DDLGenConfiguration() {
133: super ();
134: }
135:
136: //--------------------------------------------------------------------------
137: }
|