亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sqlexpression.java

?? 另外一種持久性o/m軟件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package org.apache.torque.util;/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */import java.lang.reflect.Array;import java.util.Date;import java.util.HashSet;import java.util.Iterator;import java.util.List;import org.apache.commons.lang.StringUtils;import org.apache.torque.TorqueException;import org.apache.torque.adapter.DB;import org.apache.torque.adapter.DBPostgres;import org.apache.torque.om.DateKey;import org.apache.torque.om.ObjectKey;import org.apache.torque.om.StringKey;/** * This class represents a part of an SQL query found in the <code>WHERE</code> * section.  For example: * <pre> * table_a.column_a = table_b.column_a * column LIKE 'F%' * table.column < 3 * </pre> * This class is used primarily by {@link org.apache.torque.util.BasePeer}. * * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a> * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a> * @author <a href="mailto:fedor@apache.org">Fedor Karpelevitch</a> * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a> * @version $Id: SqlExpression.java,v 1.28 2005/01/31 19:43:52 tfischer Exp $ */public class SqlExpression{    /** escaped single quote */    private static final char SINGLE_QUOTE = '\'';    /** escaped backslash */    private static final char BACKSLASH = '\\';    /**     * Used to specify a join on two columns.     *     * @param column A column in one of the tables to be joined.     * @param relatedColumn The column in the other table to be joined.     * @return A join expression, e.g. UPPER(table_a.column_a) =     *         UPPER(table_b.column_b).     */    public static String buildInnerJoin(String column, String relatedColumn)    {        // 'db' can be null because 'ignoreCase' is false.        return buildInnerJoin(column, relatedColumn, false, null);    }    /**     * Used to specify a join on two columns.     *     * @param column A column in one of the tables to be joined.     * @param relatedColumn The column in the other table to be joined.     * @param ignoreCase If true and columns represent Strings, the appropriate     *        function defined for the database will be used to ignore     *        differences in case.     * @param db Represents the database in use for vendor-specific functions.     * @return A join expression, e.g. UPPER(table_a.column_a) =     *         UPPER(table_b.column_b).     */    public static String buildInnerJoin(String column,                                         String relatedColumn,                                         boolean ignoreCase,                                         DB db)    {        int addlength = (ignoreCase) ? 25 : 1;        StringBuffer sb = new StringBuffer(column.length()                + relatedColumn.length() + addlength);        buildInnerJoin(column, relatedColumn, ignoreCase, db, sb);        return sb.toString();    }    /**     * Used to specify a join on two columns.     *     * @param column A column in one of the tables to be joined.     * @param relatedColumn The column in the other table to be joined.     * @param ignoreCase If true and columns represent Strings, the appropriate     *        function defined for the database will be used to ignore     *        differences in case.     * @param db Represents the database in use for vendor-specific functions.     * @param whereClause A StringBuffer to which the sql expression will be     *        appended.     */    public static void buildInnerJoin(String column,                                       String relatedColumn,                                       boolean ignoreCase,                                       DB db,                                       StringBuffer whereClause)    {        if (ignoreCase)        {            whereClause.append(db.ignoreCase(column))                    .append('=')                    .append(db.ignoreCase(relatedColumn));        }        else        {            whereClause.append(column)                    .append('=')                    .append(relatedColumn);        }    }    /**     * Builds a simple SQL expression.     *     * @param columnName A column.     * @param criteria The value to compare the column against.     * @param comparison One of =, &lt;, &gt;, ^lt;=, &gt;=, &lt;&gt;,     *        !=, LIKE, etc.     * @return A simple SQL expression, e.g. UPPER(table_a.column_a)     *         LIKE UPPER('ab%c').     * @throws TorqueException Any exceptions caught during processing will be     *         rethrown wrapped into a TorqueException.     */    public static String build(String columnName,                                Object criteria,                                SqlEnum comparison)        throws TorqueException    {        // 'db' can be null because 'ignoreCase' is null        return build(columnName, criteria, comparison, false, null);    }    /**     * Builds a simple SQL expression.     *     * @param columnName A column.     * @param criteria The value to compare the column against.     * @param comparison One of =, &lt;, &gt;, ^lt;=, &gt;=, &lt;&gt;,     *        !=, LIKE, etc.     * @param ignoreCase If true and columns represent Strings, the appropriate     *        function defined for the database will be used to ignore     *        differences in case.     * @param db Represents the database in use, for vendor specific functions.     * @return A simple sql expression, e.g. UPPER(table_a.column_a)     *         LIKE UPPER('ab%c').     * @throws TorqueException Any exceptions caught during processing will be     *         rethrown wrapped into a TorqueException.     */    public static String build(String columnName,                                Object criteria,                                SqlEnum comparison,                                boolean ignoreCase,                                DB db)        throws TorqueException    {        int addlength = (ignoreCase ? 40 : 20);        StringBuffer sb = new StringBuffer(columnName.length() + addlength);        build(columnName, criteria, comparison, ignoreCase, db, sb);        return sb.toString();    }    /**     * Builds a simple SQL expression.     *     * @param columnName A column.     * @param criteria The value to compare the column against.     * @param comparison One of =, &lt;, &gt;, ^lt;=, &gt;=, &lt;&gt;,     *        !=, LIKE, etc.     * @param ignoreCase If true and columns represent Strings, the appropriate     *        function defined for the database will be used to ignore     *        differences in case.     * @param db Represents the database in use, for vendor specific functions.     * @param whereClause A StringBuffer to which the sql expression will be     *        appended.     */    public static void build(String columnName,                              Object criteria,                              SqlEnum comparison,                              boolean ignoreCase,                              DB db,                              StringBuffer whereClause)    {        // Allow null criteria        // This will result in queries like        // insert into table (name, parent) values ('x', null);        //        /* Check to see if the criteria is an ObjectKey         * and if the value of that ObjectKey is null.         * In that case, criteria should be null.         */        if (criteria != null && criteria instanceof ObjectKey)        {            if (((ObjectKey) criteria).getValue() == null)            {                criteria = null;            }        }        /*  If the criteria is null, check to see comparison         *  is an =, <>, or !=.  If so, replace the comparison         *  with the proper IS or IS NOT.         */        if (criteria == null)        {            criteria = "null";            if (comparison.equals(Criteria.EQUAL))            {                comparison = Criteria.ISNULL;            }            else if (comparison.equals(Criteria.NOT_EQUAL))            {                comparison = Criteria.ISNOTNULL;            }            else if (comparison.equals(Criteria.ALT_NOT_EQUAL))            {                comparison = Criteria.ISNOTNULL;            }        }        else        {            if (criteria instanceof String || criteria instanceof StringKey)            {                criteria = quoteAndEscapeText(criteria.toString(), db);            }            else if (criteria instanceof Date)            {                Date dt = (Date) criteria;                criteria = db.getDateString(dt);            }            else if (criteria instanceof DateKey)            {                Date dt = (Date) ((DateKey) criteria).getValue();                criteria = db.getDateString(dt);            }            else if (criteria instanceof Boolean)            {                criteria = db.getBooleanString((Boolean) criteria);            }        }        if (comparison.equals(Criteria.LIKE)                || comparison.equals(Criteria.NOT_LIKE)                || comparison.equals(Criteria.ILIKE)                || comparison.equals(Criteria.NOT_ILIKE))        {            buildLike(columnName, (String) criteria, comparison,                       ignoreCase, db, whereClause);        }        else if (comparison.equals(Criteria.IN)                || comparison.equals(Criteria.NOT_IN))        {            buildIn(columnName, criteria, comparison,                     ignoreCase, db, whereClause);        }        else        {            // Do not put the upper/lower keyword around IS NULL            //  or IS NOT NULL            if (comparison.equals(Criteria.ISNULL)                    || comparison.equals(Criteria.ISNOTNULL))            {                whereClause.append(columnName)                        .append(comparison);            }            else            {                String columnValue = criteria.toString();                if (ignoreCase && db != null)                {                    columnName = db.ignoreCase(columnName);                    columnValue = db.ignoreCase(columnValue);                }                whereClause.append(columnName)                        .append(comparison)                        .append(columnValue);            }        }    }    /**     * Takes a columnName and criteria and builds an SQL phrase based     * on whether wildcards are present and the state of the     * ignoreCase flag.  Multicharacter wildcards % and * may be used     * as well as single character wildcards, _ and ?.  These     * characters can be escaped with \.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线三级电影| 色呦呦日韩精品| 首页国产丝袜综合| 亚洲国产人成综合网站| 一区二区三区四区中文字幕| 国产精品国产三级国产普通话三级 | 精品sm捆绑视频| 91精品国产91综合久久蜜臀| 日韩一二三四区| 日韩限制级电影在线观看| 日韩视频免费观看高清完整版 | 玖玖九九国产精品| 韩日精品视频一区| 成人国产精品免费网站| 91网站在线观看视频| 日本精品一区二区三区四区的功能| 成人av在线网站| 91黄色激情网站| 日韩午夜在线观看视频| 久久精品亚洲麻豆av一区二区| 国产欧美精品一区| 亚洲欧美另类久久久精品2019| 亚洲国产日韩在线一区模特| 日韩中文字幕91| 国产成a人亚洲| 91福利精品第一导航| 日韩欧美在线123| 中文字幕av一区 二区| 亚洲国产一区二区视频| 韩国v欧美v日本v亚洲v| 色综合天天天天做夜夜夜夜做| 欧美精品视频www在线观看| 久久综合狠狠综合久久激情 | 日韩国产精品久久久久久亚洲| 美脚の诱脚舐め脚责91| 99re免费视频精品全部| 欧美精品1区2区3区| 久久久久国产精品人| 亚洲欧洲精品一区二区三区不卡| 五月天一区二区三区| 国产99久久久久久免费看农村| 欧美性三三影院| 中文字幕精品一区二区三区精品| 亚洲成人动漫一区| 成人午夜激情视频| 欧美一级在线视频| 亚洲午夜在线视频| 成人av综合在线| 精品国产91亚洲一区二区三区婷婷| 亚洲日本va在线观看| 国产专区欧美精品| 7777精品伊人久久久大香线蕉的 | 成人午夜在线免费| 日韩欧美在线不卡| 亚洲国产精品自拍| k8久久久一区二区三区| 2023国产精华国产精品| 天堂资源在线中文精品| 一本色道久久综合狠狠躁的推荐| 久久综合网色—综合色88| 亚洲高清三级视频| 色婷婷综合久色| 综合激情网...| 成人av网站大全| 国产欧美va欧美不卡在线| 久久精品国产**网站演员| 5566中文字幕一区二区电影| 亚洲成人午夜电影| 在线观看免费亚洲| 夜夜揉揉日日人人青青一国产精品 | 高清国产一区二区| 久久先锋影音av鲁色资源| 日本不卡免费在线视频| 欧美美女激情18p| 午夜激情一区二区| 欧美日韩国产经典色站一区二区三区 | 亚洲精品成人在线| 播五月开心婷婷综合| 国产精品美女www爽爽爽| 精品一区二区三区免费毛片爱| 日韩午夜激情视频| 久久精品国产免费| 欧美videos大乳护士334| 日韩av在线发布| 日韩小视频在线观看专区| 日本女人一区二区三区| 欧美丰满高潮xxxx喷水动漫| 亚洲电影第三页| 日韩欧美色综合网站| 国产一二三精品| 日本一二三不卡| 91色视频在线| 午夜精品视频在线观看| 日韩午夜精品视频| 激情久久久久久久久久久久久久久久| 欧美一区二区三区四区在线观看| 另类调教123区 | 亚洲日本成人在线观看| 欧美亚洲一区二区三区四区| 天堂影院一区二区| 久久精品一区二区三区不卡牛牛| 成人免费毛片嘿嘿连载视频| 亚洲免费视频成人| 日韩欧美另类在线| 91在线精品一区二区三区| 亚洲成人综合在线| 国产欧美视频一区二区| 91精彩视频在线观看| 美女视频免费一区| 亚洲视频一二三| 日韩视频免费观看高清完整版 | 日韩中文欧美在线| 欧美韩国日本综合| 欧美精品一卡两卡| av在线播放不卡| 精品一区二区三区视频| 亚洲女厕所小便bbb| 欧美精品一区二区在线播放| 色播五月激情综合网| 久久福利视频一区二区| 亚洲精选在线视频| 国产日产精品1区| 欧美一级爆毛片| 在线影院国内精品| 成人免费视频视频| 国产又黄又大久久| 日韩国产精品大片| 一区二区欧美精品| ...av二区三区久久精品| 日韩天堂在线观看| 日本道在线观看一区二区| 国产成人av电影在线观看| 水蜜桃久久夜色精品一区的特点| 亚洲欧洲三级电影| 欧美国产丝袜视频| 久久久久久影视| 欧美v日韩v国产v| 日韩一区二区三区电影在线观看| 日本精品一级二级| 91麻豆国产香蕉久久精品| 国产精品一卡二卡在线观看| 日本午夜一本久久久综合| 午夜在线成人av| 亚洲一区二区在线免费看| 综合自拍亚洲综合图不卡区| 国产人伦精品一区二区| 久久久久国产精品人| 久久亚洲精品国产精品紫薇| 精品成人一区二区三区| 日韩精品一区二区三区蜜臀 | 中文字幕av在线一区二区三区| 精品毛片乱码1区2区3区| 欧美精品高清视频| 日本韩国欧美国产| 欧美图区在线视频| 欧美精品久久99| 日韩丝袜情趣美女图片| 日韩精品综合一本久道在线视频| 欧美精品精品一区| 日韩一区和二区| 久久久综合网站| 国产精品免费免费| 中文字幕日韩一区二区| 中文字幕av一区二区三区| 亚洲人成网站在线| 亚洲第一主播视频| 蜜臀91精品一区二区三区| 国产制服丝袜一区| av电影在线观看完整版一区二区| 成人午夜在线免费| 欧美在线综合视频| 日韩欧美一二三区| 亚洲国产精品国自产拍av| 亚洲欧美日韩国产中文在线| 午夜精品一区二区三区电影天堂| 日本不卡视频在线| 成人午夜视频网站| 欧美老肥妇做.爰bbww| 亚洲精品在线观看网站| 中文字幕中文字幕一区| 五月婷婷激情综合网| 国产精品综合av一区二区国产馆| 91亚洲精品久久久蜜桃| 在线91免费看| 国产欧美日韩在线视频| 亚洲1区2区3区视频| 国产高清不卡一区二区| 色视频欧美一区二区三区| 正在播放亚洲一区| 欧美激情一区二区三区全黄| 偷拍与自拍一区| 成人午夜在线播放| 555www色欧美视频| 中文字幕一区二区在线播放 | 国产午夜精品久久久久久免费视| 亚洲人成在线播放网站岛国| 久久精品久久综合| 色综合久久中文字幕综合网 | 亚洲欧美一区二区视频| 人人超碰91尤物精品国产|