⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typemap.java

📁 一个数据访问层Torque3.1的生成器的源代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
package org.apache.torque.engine.database.model;/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2001 The Apache Software Foundation.  All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. * * 3. The end-user documentation included with the redistribution, *    if any, must include the following acknowledgment: *       "This product includes software developed by the *        Apache Software Foundation (http://www.apache.org/)." *    Alternately, this acknowledgment may appear in the software itself, *    if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" and *    "Apache Turbine" must not be used to endorse or promote products *    derived from this software without prior written permission. For *    written permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", *    "Apache Turbine", nor may "Apache" appear in their name, without *    prior written permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation.  For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */import java.util.Hashtable;import java.sql.Types;// I don't know if the peer system deals// with the recommended mappings.////import java.sql.Date;//import java.sql.Time;//import java.sql.Timestamp;/** * A class that maps JDBC types to their corresponding * Java object types, and Java native types. Used * by Column.java to perform object/native mappings. * * These are the official SQL type to Java type mappings. * These don't quite correspond to the way the peer * system works so we'll have to make some adjustments. * <pre> * ------------------------------------------------------- * SQL Type      | Java Type            | Peer Type * ------------------------------------------------------- * CHAR          | String               | String * VARCHAR       | String               | String * LONGVARCHAR   | String               | String * NUMERIC       | java.math.BigDecimal | java.math.BigDecimal * DECIMAL       | java.math.BigDecimal | java.math.BigDecimal * BIT           | boolean OR Boolean   | Boolean * TINYINT       | byte OR Byte         | Byte * SMALLINT      | short OR Short       | Short * INTEGER       | int OR Integer       | Integer * BIGINT        | long OR Long         | Long * REAL          | float OR Float       | Float * FLOAT         | double OR Double     | Double * DOUBLE        | double OR Double     | Double * BINARY        | byte[]               | ? * VARBINARY     | byte[]               | ? * LONGVARBINARY | byte[]               | ? * DATE          | java.sql.Date        | java.util.Date * TIME          | java.sql.Time        | java.util.Date * TIMESTAMP     | java.sql.Timestamp   | java.util.Date * * ------------------------------------------------------- * A couple variations have been introduced to cover cases * that may arise, but are not covered above * BOOLEANCHAR   | boolean OR Boolean   | String * BOOLEANINT    | boolean OR Boolean   | Integer * </pre> * * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a> * @version $Id: TypeMap.java,v 1.2 2003/06/24 11:10:32 mpoeschl Exp $ */public class TypeMap{    public static final String CHAR = "CHAR";    public static final String VARCHAR = "VARCHAR";    public static final String LONGVARCHAR = "LONGVARCHAR";    public static final String CLOB = "CLOB";    public static final String NUMERIC = "NUMERIC";    public static final String DECIMAL = "DECIMAL";    public static final String BIT = "BIT";    public static final String TINYINT = "TINYINT";    public static final String SMALLINT = "SMALLINT";    public static final String INTEGER = "INTEGER";    public static final String BIGINT = "BIGINT";    public static final String REAL = "REAL";    public static final String FLOAT = "FLOAT";    public static final String DOUBLE = "DOUBLE";    public static final String BINARY = "BINARY";    public static final String VARBINARY = "VARBINARY";    public static final String LONGVARBINARY = "LONGVARBINARY";    public static final String BLOB = "BLOB";    public static final String DATE = "DATE";    public static final String TIME = "TIME";    public static final String TIMESTAMP = "TIMESTAMP";    public static final String BOOLEANCHAR = "BOOLEANCHAR";    public static final String BOOLEANINT = "BOOLEANINT";    private static final String[] TEXT_TYPES =    {        CHAR, VARCHAR, LONGVARCHAR, CLOB, DATE, TIME, TIMESTAMP, BOOLEANCHAR    };    public static final String CHAR_OBJECT_TYPE = "new String()";    public static final String VARCHAR_OBJECT_TYPE = "new String()";    public static final String LONGVARCHAR_OBJECT_TYPE = "new String()";    public static final String CLOB_OBJECT_TYPE = "new String()";    public static final String NUMERIC_OBJECT_TYPE = "new BigDecimal(0)";    public static final String DECIMAL_OBJECT_TYPE = "new BigDecimal(0)";    public static final String BIT_OBJECT_TYPE = "new Boolean(true)";    public static final String TINYINT_OBJECT_TYPE = "new Byte((byte)0)";    public static final String SMALLINT_OBJECT_TYPE = "new Short((short)0)";    public static final String INTEGER_OBJECT_TYPE = "new Integer(0)";    public static final String BIGINT_OBJECT_TYPE = "new Long(0)";    public static final String REAL_OBJECT_TYPE = "new Float(0)";    public static final String FLOAT_OBJECT_TYPE = "new Double(0)";    public static final String DOUBLE_OBJECT_TYPE = "new Double(0)";    public static final String BINARY_OBJECT_TYPE = "new Object()"; //?    public static final String VARBINARY_OBJECT_TYPE = "new Object()"; //?    public static final String LONGVARBINARY_OBJECT_TYPE = "new Object()"; //?    public static final String BLOB_OBJECT_TYPE = "new Object()"; //?    public static final String DATE_OBJECT_TYPE = "new Date()";    public static final String TIME_OBJECT_TYPE = "new Date()";    public static final String TIMESTAMP_OBJECT_TYPE = "new Date()";    public static final String BOOLEANCHAR_OBJECT_TYPE = "new String()";    public static final String BOOLEANINT_OBJECT_TYPE = "new Integer(0)";    public static final String CHAR_NATIVE_TYPE = "String";    public static final String VARCHAR_NATIVE_TYPE = "String";    public static final String LONGVARCHAR_NATIVE_TYPE = "String";    public static final String CLOB_NATIVE_TYPE = "String";    public static final String NUMERIC_NATIVE_TYPE = "BigDecimal";    public static final String DECIMAL_NATIVE_TYPE = "BigDecimal";    public static final String BIT_NATIVE_TYPE = "boolean";    public static final String TINYINT_NATIVE_TYPE = "byte";    public static final String SMALLINT_NATIVE_TYPE = "short";    public static final String INTEGER_NATIVE_TYPE = "int";    public static final String BIGINT_NATIVE_TYPE = "long";    public static final String REAL_NATIVE_TYPE = "float";    public static final String FLOAT_NATIVE_TYPE = "double";    public static final String DOUBLE_NATIVE_TYPE = "double";    public static final String BINARY_NATIVE_TYPE = "byte[]";    public static final String VARBINARY_NATIVE_TYPE = "byte[]";    public static final String LONGVARBINARY_NATIVE_TYPE = "byte[]";    public static final String BLOB_NATIVE_TYPE = "byte[]";    public static final String DATE_NATIVE_TYPE = "Date";    public static final String TIME_NATIVE_TYPE = "Date";    public static final String TIMESTAMP_NATIVE_TYPE = "Date";    public static final String BOOLEANCHAR_NATIVE_TYPE = "boolean";    public static final String BOOLEANINT_NATIVE_TYPE = "boolean";    public static final String BIT_NATIVE_OBJECT_TYPE = "Boolean";    public static final String TINYINT_NATIVE_OBJECT_TYPE = "Byte";    public static final String SMALLINT_NATIVE_OBJECT_TYPE = "Short";    public static final String INTEGER_NATIVE_OBJECT_TYPE = "Integer";    public static final String BIGINT_NATIVE_OBJECT_TYPE = "Long";    public static final String REAL_NATIVE_OBJECT_TYPE = "Float";    public static final String FLOAT_NATIVE_OBJECT_TYPE = "Double";    public static final String DOUBLE_NATIVE_OBJECT_TYPE = "Double";    public static final String BOOLEANCHAR_NATIVE_OBJECT_TYPE = "Boolean";    public static final String BOOLEANINT_NATIVE_OBJECT_TYPE = "Boolean";    public static final String CHAR_VILLAGE_METHOD = "asString()";    public static final String VARCHAR_VILLAGE_METHOD = "asString()";    public static final String LONGVARCHAR_VILLAGE_METHOD = "asString()";    public static final String CLOB_VILLAGE_METHOD = "asString()";    public static final String NUMERIC_VILLAGE_METHOD = "asBigDecimal()";    public static final String DECIMAL_VILLAGE_METHOD = "asBigDecimal()";    public static final String BIT_VILLAGE_METHOD = "asBoolean()";    public static final String TINYINT_VILLAGE_METHOD = "asByte()";    public static final String SMALLINT_VILLAGE_METHOD = "asShort()";    public static final String INTEGER_VILLAGE_METHOD = "asInt()";    public static final String BIGINT_VILLAGE_METHOD = "asLong()";    public static final String REAL_VILLAGE_METHOD = "asFloat()";    public static final String FLOAT_VILLAGE_METHOD = "asDouble()";    public static final String DOUBLE_VILLAGE_METHOD = "asDouble()";    public static final String BINARY_VILLAGE_METHOD = "asBytes()";    public static final String VARBINARY_VILLAGE_METHOD = "asBytes()";    public static final String LONGVARBINARY_VILLAGE_METHOD = "asBytes()";    public static final String BLOB_VILLAGE_METHOD = "asBytes()";    public static final String DATE_VILLAGE_METHOD = "asUtilDate()";    public static final String TIME_VILLAGE_METHOD = "asUtilDate()";    public static final String TIMESTAMP_VILLAGE_METHOD = "asUtilDate()";    public static final String BOOLEANCHAR_VILLAGE_METHOD = "asBoolean()";    public static final String BOOLEANINT_VILLAGE_METHOD = "asBoolean()";    public static final String BIT_VILLAGE_OBJECT_METHOD = "asBooleanObj()";    public static final String TINYINT_VILLAGE_OBJECT_METHOD = "asByteObj()";    public static final String SMALLINT_VILLAGE_OBJECT_METHOD = "asShortObj()";    public static final String INTEGER_VILLAGE_OBJECT_METHOD = "asIntegerObj()";    public static final String BIGINT_VILLAGE_OBJECT_METHOD = "asLongObj()";    public static final String REAL_VILLAGE_OBJECT_METHOD = "asFloatObj()";    public static final String FLOAT_VILLAGE_OBJECT_METHOD = "asDoubleObj()";    public static final String DOUBLE_VILLAGE_OBJECT_METHOD = "asDoubleObj()";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -