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

📄 objectinfo.java

📁 一个Java持久层类库
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package ActiveObject.vo;import ActiveObject.core.ActiveRecord;import java.lang.reflect.Field;import ActiveObject.exception.*;import java.sql.PreparedStatement;import java.sql.SQLException;import java.util.HashMap;import java.util.List;import java.util.Map;/** * @author Administrator */public class ObjectInfo {    private String tableName ;    private Map<Field, Accesstor> fieldAccesstorMapping = null;    private BasicSqlStatement sqlStatement = null;    private Accesstor[] accesstor = null;    private Accesstor[] identify = null;    private Map<Class, List> hasMany = new HashMap<Class, List>();    private Map<Class, List> hasOne = new HashMap<Class, List>();    private LinkMap[] linkMap = null;    public final void setupDeleteParams(PreparedStatement stmt, ActiveRecord object)throws ObjectAnalysisException, SQLException    {        int index = 1;        try        {            for(Accesstor a : identify)            {                stmt.setObject(index++, a.invokeGetValue(object));            }        }        catch(SQLException err)        {            throw err;        }        catch(Exception err)        {            throw new ObjectAnalysisException(err.toString(), err);        }    }    public final void setupUpdateParams(PreparedStatement stmt, ActiveRecord object)throws ObjectAnalysisException, SQLException    {        int index = 1;        try        {            for(Accesstor a : accesstor)            {                stmt.setObject(index++, a.invokeGetValue(object));            }            for(Accesstor a : identify)            {                stmt.setObject(index++, a.invokeGetValue(object));            }        }        catch(SQLException err)        {            throw err;        }        catch(Exception err)        {            throw new ObjectAnalysisException(err.toString(), err);        }    }    public final void setupSaveParams(PreparedStatement stmt, ActiveRecord object)throws ObjectAnalysisException, SQLException    {        int index = 1;        try        {            for(Accesstor a : identify)            {                stmt.setObject(index++, null);//a.invokeGetValue(object)            }            for(Accesstor a : accesstor)            {                stmt.setObject(index++, a.invokeGetValue(object));            }        }        catch(SQLException err)        {            throw err;        }        catch(Exception err)        {            throw new ObjectAnalysisException(err.toString(), err);        }    }    public ObjectInfo()    {}        public ObjectInfo(Map<Field, Accesstor> fieldAccesstorMapping)    {        this.fieldAccesstorMapping = fieldAccesstorMapping;    }        public ObjectInfo(BasicSqlStatement sqlStatement)    {        this.sqlStatement = sqlStatement;    }        public ObjectInfo(Map<Field, Accesstor> fieldAccesstorMapping, BasicSqlStatement sqlStatement)    {        this.fieldAccesstorMapping = fieldAccesstorMapping;        this.sqlStatement = sqlStatement;    }    public ObjectInfo(Map<Field, Accesstor> fieldAccesstorMapping, Accesstor[] attribute)    {        this.fieldAccesstorMapping = fieldAccesstorMapping;        this.accesstor = attribute;    }        public Map<Field, Accesstor> getFieldAccesstorMapping() {        return fieldAccesstorMapping;    }    public void setFieldAccesstorMapping(Map<Field, Accesstor> fieldAccesstorMapping) {        this.fieldAccesstorMapping = fieldAccesstorMapping;    }    public BasicSqlStatement getBasicSqlStatement() {        return sqlStatement;    }    public void setBasicSqlStatement(BasicSqlStatement sqlStatement) {        this.sqlStatement = sqlStatement;    }    /**     * @return the attribute     */    public Accesstor[] getAccesstor() {        return accesstor;    }    /**     * @param attribute the attribute to set     */    public void setAccesstor(Accesstor[] attribute) {        this.accesstor = attribute;    }    /**     * @return the hasMany     */    public Map<Class, List> getHasMany() {        return hasMany;    }    /**     * @param hasMany the hasMany to set     */    public void setHasMany(Map<Class, List> hasMany) {        this.hasMany = hasMany;    }    /**     * @return the hasOne     */    public Map<Class, List> getHasOne() {        return hasOne;    }    /**     * @param hasOne the hasOne to set     */    public void setHasOne(Map<Class, List> hasOne) {        this.hasOne = hasOne;    }    /**     * @return the linkMap     */    public LinkMap[] getLinkMap() {        return linkMap;    }    /**     * @param linkMap the linkMap to set     */    public void setLinkMap(LinkMap[] linkMap) {        this.linkMap = linkMap;    }    /**     * @return the identify     */    public Accesstor[] getIdentify() {        return identify;    }    /**     * @param identify the identify to set     */    public void setIdentify(Accesstor[] identify) {        this.identify = identify;    }    /**     * @return the tableName     */    public String getTableName() {        return tableName;    }    /**     * @param tableName the tableName to set     */    public void setTableName(String tableName) {        this.tableName = tableName;    }}

⌨️ 快捷键说明

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