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

📄 typemap.java

📁 一个数据访问层Torque3.1的生成器的源代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            jdbcToTorqueTypeMap.put(new Integer(Types.CHAR), CHAR);            jdbcToTorqueTypeMap.put(new Integer(Types.VARCHAR), VARCHAR);            jdbcToTorqueTypeMap.put(new Integer(Types.LONGVARCHAR), LONGVARCHAR);            jdbcToTorqueTypeMap.put(new Integer(Types.CLOB), CLOB);            jdbcToTorqueTypeMap.put(new Integer(Types.NUMERIC), NUMERIC);            jdbcToTorqueTypeMap.put(new Integer(Types.DECIMAL), DECIMAL);            jdbcToTorqueTypeMap.put(new Integer(Types.BIT), BIT);            jdbcToTorqueTypeMap.put(new Integer(Types.TINYINT), TINYINT);            jdbcToTorqueTypeMap.put(new Integer(Types.SMALLINT), SMALLINT);            jdbcToTorqueTypeMap.put(new Integer(Types.INTEGER), INTEGER);            jdbcToTorqueTypeMap.put(new Integer(Types.BIGINT), BIGINT);            jdbcToTorqueTypeMap.put(new Integer(Types.REAL), REAL);            jdbcToTorqueTypeMap.put(new Integer(Types.FLOAT), FLOAT);            jdbcToTorqueTypeMap.put(new Integer(Types.DOUBLE), DOUBLE);            jdbcToTorqueTypeMap.put(new Integer(Types.BINARY), BINARY);            jdbcToTorqueTypeMap.put(new Integer(Types.VARBINARY), VARBINARY);            jdbcToTorqueTypeMap.put(new Integer(Types.LONGVARBINARY), LONGVARBINARY);            jdbcToTorqueTypeMap.put(new Integer(Types.BLOB), BLOB);            jdbcToTorqueTypeMap.put(new Integer(Types.DATE), DATE);            jdbcToTorqueTypeMap.put(new Integer(Types.TIME), TIME);            jdbcToTorqueTypeMap.put(new Integer(Types.TIMESTAMP), TIMESTAMP);            isInitialized = true;        }    }    /**     * Report whether this object has been initialized.     *     * @return true if this object has been initialized     */    public static boolean isInitialized()    {        return isInitialized;    }    /**     * Return a Java object which corresponds to the     * JDBC type provided. Use in MapBuilder generation.     *     * @param jdbcType the JDBC type     * @return name of the Object     */    public static String getJavaObject(String jdbcType)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        return (String) jdbcToJavaObjectMap.get(jdbcType);    }    /**     * Return native java type which corresponds to the     * JDBC type provided. Use in the base object class generation.     *     * @param jdbcType the JDBC type     * @return name of the native java type     */    public static String getJavaNative(String jdbcType)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        return (String) jdbcToJavaNativeMap.get(jdbcType);    }    /**     * Return native java type which corresponds to the     * JDBC type provided. Use in the base object class generation.     *     * @param jdbcType the JDBC type     * @return name of the Object     */    public static String getJavaNativeObject(String jdbcType)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        String s = (String) jdbcToJavaNativeObjectMap.get(jdbcType);        if (s == null)        {            s = (String) jdbcToJavaNativeMap.get(jdbcType);        }        return s;    }    /**     * Return Village asX() method which corresponds to the     * JDBC type provided. Use in the Peer class generation.     *     * @param jdbcType the JDBC type     * @return name of the Village asX() method     */    public static String getVillageMethod(String jdbcType)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        return (String) jdbcToVillageMethodMap.get(jdbcType);    }    /**     * Return Village asX() method which corresponds to the     * JDBC type provided. Use in the Peer class generation.     *     * @param jdbcType the JDBC type     * @return name of the Village asX() method     */    public static String getVillageObjectMethod(String jdbcType)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        String s = (String) jdbcToVillageObjectMethodMap.get(jdbcType);        if (s == null)        {            s = (String) jdbcToVillageMethodMap.get(jdbcType);        }        return s;    }    /**     * Return ParameterParser getX() method which corresponds to the     * JDBC type provided. Use in the Object class generation.     *     * @param jdbcType the JDBC type     * @return name of the ParameterParser getX() method     */    public static String getPPMethod(String jdbcType)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        return (String) jdbcToPPMethodMap.get(jdbcType);    }    /**     * Returns the correct jdbc type for torque added types     *     * @param type the torque added type     * @return name of the the correct jdbc type     */    public static String getJdbcType(String type)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        return (String) torqueTypeToJdbcTypeMap.get(type);    }    /**     * Returns Torque type constant corresponding to JDBC type code.     * Used but Torque JDBC task.     *     * @param sqlType the SQL type     * @return Torque type constant     */    public static String getTorqueType(Integer sqlType)    {        // Make sure the we are initialized.        if (!isInitialized)        {            initialize();        }        return (String) jdbcToTorqueTypeMap.get(sqlType);    }    /**     * Returns true if the type is boolean in the java     * object and a numeric (1 or 0) in the db.     *     * @param type The type to check.     * @return true if the type is BOOLEANINT     */    public static boolean isBooleanInt(String type)    {        return BOOLEANINT.equals(type);    }    /**     * Returns true if the type is boolean in the     * java object and a String "Y" or "N" in the db.     *     * @param type The type to check.     * @return true if the type is BOOLEANCHAR     */    public static boolean isBooleanChar(String type)    {        return BOOLEANCHAR.equals(type);    }    /**     * Returns true if values for the type need to be quoted.     *     * @param type The type to check.     * @return true if values for the type need to be quoted.     */    public static final boolean isTextType(String type)    {        for (int i = 0; i < TEXT_TYPES.length; i++)        {            if (type.equals(TEXT_TYPES[i]))            {                return true;            }        }        // If we get this far, there were no matches.        return false;    }}

⌨️ 快捷键说明

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