KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapping > CompilationContext


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 XQuark Group.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.mapping;
24
25 import java.util.Properties JavaDoc;
26
27 import org.xquark.jdbc.typing.DBMSConstants;
28
29 /**
30  * Provide access to the mapping compilation context allowing to use the same
31  * generator code for multiple use. Some properties directly provided by the
32  * mapping engine are listed as constants in the current class. Custom parameters
33  * supplied by user in the mapping file will be provided as additional properties.
34  * A user generator that intends to use this compilation context must provide a
35  * constructor with this class as a unique parameter.
36  * @see org.xquark.mapping.KeyGenerator for an example of use.
37  */

38 public class CompilationContext extends Properties JavaDoc implements DBMSConstants {
39
40     /**
41      * This property contains the name of the table where the generator value
42      * will be stored.
43      */

44     public static final String JavaDoc TABLE_NAME = "table";
45
46     /**
47      * This property contains the name of the column where the generator value
48      * will be stored.
49      */

50     public static final String JavaDoc COLUMN_NAME = "column";
51     
52     /**
53      * Returns one of the following constants: {@link #ORACLE}, {@link #MYSQL},
54      * {@link #SQL_SERVER}, {@link #SYBASE}. This gives the database vendor Bridge
55      * is connected to and can be use to swicth between specific SQL syntaxes.
56      */

57     public static final String JavaDoc DBMS_TYPE = "dbms";
58     
59     /**
60      * If "true", a SQL or DDL JDBC statement should use double quotes to surround
61      * table, column names and others DDL objects to avoid unwanted case automatic
62      * transformation.
63      */

64     public static final String JavaDoc USE_QUOTES_4_DDL = "use_quotes";
65 }
66
67
Popular Tags