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

📄 oraclecolumninfocache.java

📁 羽量级数据持久层开发框架
💻 JAVA
字号:
package org.speedframework.cache.oracle;

//~--- non-JDK imports --------------------------------------------------------

import org.speedframework.cache.AbstractColumnInfoCache;
import org.speedframework.entity.CacheColumnBean;
import org.speedframework.utilities.StringUtils;

//~--- JDK imports ------------------------------------------------------------

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 *  类描述信息,描述类的主要职责和用处。
 *
 *
 * @version    $LastChangedRevision: 1945 $, 2007.09.29 at 02:14:28 CST
 * @author     <a href="mailto:falcon8848@gmail.com">piginzoo </a>
 */
public class OracleColumnInfoCache extends AbstractColumnInfoCache
 {

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param table
     * @param columnInfo
     *
     * @throws Exception
     */
    public void putColumnInfo(Object table, List columnInfo) throws Exception {
        List     colunm    = null;
        String   tableName = StringUtils.getExcuteTableName(table.getClass());
        Iterator it        = columnInfo.iterator();

        if (it.hasNext()) {
            colunm = new ArrayList();
        }

        while (it.hasNext()) {
            Map             entity        = (Map) it.next();
            String          columnName    = (String) entity.get("field");
            String          primaryKey    = (String) entity.get("pk");
            String          dataType      = (String) entity.get("data_type");
            String          autoincrement = (String) entity.get("autoincrement");
            CacheColumnBean ccb           = new CacheColumnBean();

            ccb.setColumnname(columnName.toLowerCase());
            ccb.setDatatype(dataType.toLowerCase());

            if ((primaryKey != null) &&!primaryKey.equals("")) {
                ccb.setPrimarykey(true);
            }

            if ((autoincrement != null) &&!autoincrement.equals("")) {
                ccb.setAutoincrement(true);
            }

            colunm.add(ccb);
        }

        ca.save(tableName, colunm);
    }
}

⌨️ 快捷键说明

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