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

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

?? basepeer.java

?? 另外一種持久性o/m軟件
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
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.io.Serializable;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.SQLException;import java.sql.Statement;import java.util.ArrayList;import java.util.Collections;import java.util.HashSet;import java.util.Hashtable;import java.util.Iterator;import java.util.List;import java.util.Set;import org.apache.commons.lang.StringUtils;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.apache.torque.Torque;import org.apache.torque.TorqueException;import org.apache.torque.adapter.DB;import org.apache.torque.map.ColumnMap;import org.apache.torque.map.DatabaseMap;import org.apache.torque.map.MapBuilder;import org.apache.torque.map.TableMap;import org.apache.torque.oid.IdGenerator;import org.apache.torque.om.NumberKey;import org.apache.torque.om.ObjectKey;import org.apache.torque.om.SimpleKey;import org.apache.torque.om.StringKey;import com.workingdogs.village.Column;import com.workingdogs.village.DataSet;import com.workingdogs.village.KeyDef;import com.workingdogs.village.QueryDataSet;import com.workingdogs.village.Record;import com.workingdogs.village.Schema;import com.workingdogs.village.TableDataSet;/** * This is the base class for all Peer classes in the system.  Peer * classes are responsible for isolating all of the database access * for a specific business object.  They execute all of the SQL * against the database.  Over time this class has grown to include * utility methods which ease execution of cross-database queries and * the implementation of concrete Peers. * * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a> * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a> * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a> * @author <a href="mailto:stephenh@chase3000.com">Stephen Haberman</a> * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a> * @author <a href="mailto:vido@ldh.org">Augustin Vidovic</a> * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a> * @version $Id: BasePeer.java,v 1.82 2005/06/27 20:34:41 tfischer Exp $ */public abstract class BasePeer         implements Serializable{    /** Constant criteria key to reference ORDER BY columns. */    public static final String ORDER_BY = "ORDER BY";    /**     * Constant criteria key to remove Case Information from     * search/ordering criteria.     */    public static final String IGNORE_CASE = "IgNOrE cAsE";    /** Classes that implement this class should override this value. */    public static final String TABLE_NAME = "TABLE_NAME";    /** Hashtable that contains the cached mapBuilders. */    private static Hashtable mapBuilders = new Hashtable(5);    /** the log */    protected static Log log = LogFactory.getLog(BasePeer.class);    private static void throwTorqueException(Exception e)        throws TorqueException    {        if (e instanceof TorqueException)         {            throw (TorqueException) e;        }        else         {            throw new TorqueException(e);        }    }    /**     * Sets up a Schema for a table.  This schema is then normally     * used as the argument for initTableColumns().     *     * @param tableName The name of the table.     * @return A Schema.     */    public static Schema initTableSchema(String tableName)    {        return initTableSchema(tableName, Torque.getDefaultDB());    }    /**     * Sets up a Schema for a table.  This schema is then normally     * used as the argument for initTableColumns     *     * @param tableName The propery name for the database in the     * configuration file.     * @param dbName The name of the database.     * @return A Schema.     */    public static Schema initTableSchema(String tableName, String dbName)    {        Schema schema = null;        Connection con = null;        try        {            con = Torque.getConnection(dbName);            schema = new Schema().schema(con, tableName);        }        catch (Exception e)        {            log.error(e);            throw new Error("Error in BasePeer.initTableSchema("                    + tableName                    + "): "                    + e.getMessage());        }        finally        {            Torque.closeConnection(con);        }        return schema;    }    /**     * Creates a Column array for a table based on its Schema.     *     * @param schema A Schema object.     * @return A Column[].     */    public static Column[] initTableColumns(Schema schema)    {        Column[] columns = null;        try        {            int numberOfColumns = schema.numberOfColumns();            columns = new Column[numberOfColumns];            for (int i = 0; i < numberOfColumns; i++)            {                columns[i] = schema.column(i + 1);            }        }        catch (Exception e)        {            log.error(e);            throw new Error(                "Error in BasePeer.initTableColumns(): " + e.getMessage());        }        return columns;    }    /**     * Convenience method to create a String array of column names.     *     * @param columns A Column[].     * @return A String[].     */    public static String[] initColumnNames(Column[] columns)    {        String[] columnNames = null;        columnNames = new String[columns.length];        for (int i = 0; i < columns.length; i++)        {            columnNames[i] = columns[i].name().toUpperCase();        }        return columnNames;    }    /**     * Convenience method to create a String array of criteria keys.     *     * @param tableName Name of table.     * @param columnNames A String[].     * @return A String[].     */    public static String[] initCriteriaKeys(        String tableName,        String[] columnNames)    {        String[] keys = new String[columnNames.length];        for (int i = 0; i < columnNames.length; i++)        {            keys[i] = tableName + "." + columnNames[i].toUpperCase();        }        return keys;    }    /**     * Convenience method that uses straight JDBC to delete multiple     * rows.  Village throws an Exception when multiple rows are     * deleted.     *     * @param con A Connection.     * @param table The table to delete records from.     * @param column The column in the where clause.     * @param value The value of the column.     * @throws TorqueException Any exceptions caught during processing will be     *         rethrown wrapped into a TorqueException.     */    public static void deleteAll(        Connection con,        String table,        String column,        int value)        throws TorqueException    {        Statement statement = null;        try        {            statement = con.createStatement();            StringBuffer query = new StringBuffer();            query.append("DELETE FROM ")                .append(table)                .append(" WHERE ")                .append(column)                .append(" = ")                .append(value);            statement.executeUpdate(query.toString());        }        catch (SQLException e)        {            throw new TorqueException(e);        }        finally        {            if (statement != null)            {                try                {                    statement.close();                }                catch (SQLException ignored)                {                }            }        }    }    /**     * Convenience method that uses straight JDBC to delete multiple     * rows.  Village throws an Exception when multiple rows are     * deleted.  This method attempts to get the default database from     * the pool.     *     * @param table The table to delete records from.     * @param column The column in the where clause.     * @param value The value of the column.     * @throws TorqueException Any exceptions caught during processing will be     *         rethrown wrapped into a TorqueException.     */    public static void deleteAll(String table, String column, int value)        throws TorqueException    {        Connection con = null;        try        {            // Get a connection to the db.            con = Torque.getConnection(Torque.getDefaultDB());            deleteAll(con, table, column, value);        }        finally        {            Torque.closeConnection(con);        }    }    /**     * Method to perform deletes based on values and keys in a     * Criteria.     *     * @param criteria The criteria to use.     * @throws TorqueException Any exceptions caught during processing will be     *         rethrown wrapped into a TorqueException.     */    public static void doDelete(Criteria criteria) throws TorqueException    {        Connection con = null;        try        {            con = Transaction.beginOptional(                    criteria.getDbName(),                    criteria.isUseTransaction());            doDelete(criteria, con);            Transaction.commit(con);        }        catch (TorqueException e)        {            Transaction.safeRollback(con);            throw e;        }    }    /**     * Method to perform deletes based on values and keys in a Criteria.     *     * @param criteria The criteria to use.     * @param con A Connection.     * @throws TorqueException Any exceptions caught during processing will be     *         rethrown wrapped into a TorqueException.     */    public static void doDelete(Criteria criteria, Connection con)        throws TorqueException    {        String dbName = criteria.getDbName();        final DB db = Torque.getDB(dbName);        final DatabaseMap dbMap = Torque.getDatabaseMap(dbName);        // This Callback adds all tables to the Table set which         // are referenced from a cascading criteria. As a result, all        // data that is referenced through foreign keys will also be        // deleted.        SQLBuilder.TableCallback tc = new SQLBuilder.TableCallback() {                public void process (Set tables, String key, Criteria crit)                {                    if (crit.isCascade())                    {                        // This steps thru all the columns in the database.                        TableMap[] tableMaps = dbMap.getTables();                        for (int i = 0; i < tableMaps.length; i++)                        {                            ColumnMap[] columnMaps = tableMaps[i].getColumns();                            for (int j = 0; j < columnMaps.length; j++)                            {                                // Only delete rows where the foreign key is                                // also a primary key.  Other rows need                                // updating, but that is not implemented.                                if (columnMaps[j].isForeignKey()                                        && columnMaps[j].isPrimaryKey()                                        && key.equals(columnMaps[j].getRelatedName()))                                {                                    tables.add(tableMaps[i].getName());                                    crit.add(columnMaps[j].getFullyQualifiedName(),                                            crit.getValue(key));                                }                            }                        }                    }                }            };        Set tables = SQLBuilder.getTableSet(criteria, tc);        try        {            processTables(criteria, tables, con, new ProcessCallback() {                    public void process(String table, String dbName, Record rec)                        throws Exception                    {                        rec.markToBeDeleted();                        rec.save();                    }                });        }        catch (Exception e)        {            throwTorqueException(e);        }    }    /**     * Method to perform inserts based on values and keys in a     * Criteria.     * <p>     * If the primary key is auto incremented the data in Criteria     * will be inserted and the auto increment value will be returned.     * <p>     * If the primary key is included in Criteria then that value will     * be used to insert the row.     * <p>     * If no primary key is included in Criteria then we will try to     * figure out the primary key from the database map and insert the     * row with the next available id using util.db.IDBroker.     * <p>     * If no primary key is defined for the table the values will be     * inserted as specified in Criteria and -1 will be returned.     *     * @param criteria Object containing values to insert.     * @return An Object which is the id of the row that was inserted     * (if the table has a primary key) or null (if the table does not

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
3atv一区二区三区| 国产精品免费aⅴ片在线观看| 久久av老司机精品网站导航| 国产精品毛片无遮挡高清| 欧美性一区二区| 成人ar影院免费观看视频| 首页综合国产亚洲丝袜| 亚洲欧洲国产日韩| 精品久久久三级丝袜| 欧美在线观看视频在线| 成人永久aaa| 国产综合色产在线精品| 日日摸夜夜添夜夜添国产精品| 国产精品入口麻豆原神| 欧美一区二区三区四区久久 | 岛国精品在线播放| 日韩精品视频网站| 一区二区三区精品视频| 国产精品蜜臀av| 久久精品综合网| 日韩一区二区三区视频在线| 在线观看亚洲一区| 99久久99久久久精品齐齐| 国产精品18久久久久| 麻豆精品在线观看| 奇米在线7777在线精品 | 亚洲午夜精品17c| 国产精品理论在线观看| 欧美精品一区二区蜜臀亚洲| 91麻豆精品国产91久久久久久久久| 日本久久精品电影| 91麻豆免费看片| a4yy欧美一区二区三区| 成人成人成人在线视频| 国产盗摄视频一区二区三区| 麻豆精品在线播放| 久久国产乱子精品免费女| 美女网站在线免费欧美精品| 日韩高清国产一区在线| 日日夜夜精品视频免费| 婷婷久久综合九色综合伊人色| 亚洲影院理伦片| 亚洲影院久久精品| 亚洲一区二区三区四区在线| 亚洲一区视频在线观看视频| 一区二区三区91| 一区二区三区欧美日| 一区二区三区四区在线| 亚洲一区中文在线| 亚洲韩国精品一区| 日韩av一级片| 国产一区二区精品久久99| 国产成人免费9x9x人网站视频| 国产成人在线免费观看| 成人app软件下载大全免费| 99久久精品国产观看| 欧美综合亚洲图片综合区| 欧美日韩精品二区第二页| 欧美一区二区视频观看视频| 26uuu国产在线精品一区二区| 久久久91精品国产一区二区精品 | 综合久久一区二区三区| 一区二区三区日韩欧美| 日韩精品一卡二卡三卡四卡无卡| 奇米888四色在线精品| 黄色日韩三级电影| 成人av资源站| 欧美日韩精品久久久| 精品久久久久久久久久久久久久久 | 一区二区三区中文在线观看| 亚洲成人精品在线观看| 极品少妇xxxx偷拍精品少妇| 风间由美性色一区二区三区| 在线观看欧美黄色| 欧美电影免费观看高清完整版在线观看| 亚洲精品在线观看视频| 国产精品久久毛片av大全日韩| 亚洲精品v日韩精品| 美国欧美日韩国产在线播放| 不卡视频免费播放| 欧美男女性生活在线直播观看| 欧美成人a视频| 中文字幕在线观看一区| 午夜电影一区二区| 大美女一区二区三区| 欧美日韩精品久久久| 国产日产欧美一区| 亚洲高清视频中文字幕| 国产精品一区二区三区网站| 一本色道亚洲精品aⅴ| 日韩一区二区在线观看视频播放| 国产精品人妖ts系列视频| 日韩av在线播放中文字幕| 成人app下载| 精品国精品国产| 亚洲另类在线视频| 国产麻豆欧美日韩一区| 欧美日韩一区二区三区四区五区| 久久久高清一区二区三区| 午夜精品国产更新| eeuss国产一区二区三区| 欧美一级二级三级蜜桃| 亚洲黄色性网站| 国产成人精品免费视频网站| 欧美日韩国产天堂| 亚洲色图欧美偷拍| 国产精品中文字幕日韩精品 | 国产一区啦啦啦在线观看| 欧美在线你懂得| 中文字幕一区二区三区在线播放 | 国产精品一区二区在线播放| 欧美精品久久一区| 亚洲六月丁香色婷婷综合久久| 久草这里只有精品视频| 欧美日韩黄色影视| 一区二区三区欧美亚洲| 99热精品一区二区| 久久色.com| 激情六月婷婷久久| 日韩精品中文字幕在线一区| 亚洲高清不卡在线| 在线观看不卡一区| 亚洲三级免费电影| www.欧美色图| 国产精品污www在线观看| 国产精品一卡二| 精品国产99国产精品| 免费在线视频一区| 91精品国产综合久久精品| 亚洲电影在线免费观看| 欧美丝袜丝交足nylons| 亚洲一级电影视频| 91毛片在线观看| 一区二区在线电影| 91黄色免费看| 亚洲一区二区三区爽爽爽爽爽| 色呦呦日韩精品| 亚洲制服丝袜av| 欧美午夜视频网站| 午夜精品福利一区二区三区av| 欧美视频一区二区在线观看| 亚洲小说春色综合另类电影| 欧洲视频一区二区| 亚洲 欧美综合在线网络| 欧美日韩成人高清| 日韩高清在线一区| 欧美成人综合网站| 国产在线精品一区二区三区不卡| 久久综合网色—综合色88| 久久99精品视频| 国产日韩影视精品| 成人av在线电影| 一区二区三区日韩精品| 欧美日韩国产三级| 久久成人久久爱| 国产亚洲成av人在线观看导航| 丁香六月综合激情| 亚洲乱码日产精品bd| 欧美日韩国产a| 精品一区二区免费视频| 国产欧美日韩不卡免费| 91视频观看视频| 三级影片在线观看欧美日韩一区二区 | 免费在线成人网| 精品毛片乱码1区2区3区| 成人开心网精品视频| 夜夜嗨av一区二区三区网页 | 国产成人精品免费| 一区二区三区四区激情| 欧美日韩极品在线观看一区| 精品影视av免费| 亚洲丝袜美腿综合| 91精品国产综合久久久久久久| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲视频每日更新| 91精品国产综合久久久久久久| 国产成人在线看| 午夜视频在线观看一区| 精品1区2区在线观看| 91成人免费在线视频| 精油按摩中文字幕久久| 亚洲日本欧美天堂| 精品日本一线二线三线不卡| 99久久国产综合精品麻豆| 蜜桃视频在线观看一区二区| 国产日韩欧美制服另类| 欧美天天综合网| 国产精品羞羞答答xxdd| 亚洲综合一区在线| 久久女同精品一区二区| 欧美午夜理伦三级在线观看| 韩国毛片一区二区三区| 亚洲制服丝袜一区| 国产精品你懂的| 欧美一区二区成人6969| 91麻豆国产精品久久| 国产麻豆9l精品三级站| 丝袜美腿亚洲一区| 中文字幕一区视频| 久久精品一区四区|