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

📄 applicationmbean.java

📁 具备多表组合查询组件功能。通过将表字段与表间关系映射到对象关系及属性
💻 JAVA
字号:
package cn.edu.buaa.ieguam.logmanage.mbeans;

import java.util.HashMap;
import cn.edu.buaa.ieguam.logmanage.MBean;


/**
 * MBean for Application
 * @author tongxiaodong
 * Creation time:Dec 2, 2006 5:43:34 PM
 */

public class ApplicationMBean extends MBean{
	
	
	/**
	 * 初始化
	 */
	public void init()
	{
		this.setPkName("id");
		this.setPojoName("application");
		this.setTableName("APPLICATION");
		this.createOrmMap();
		this.createFkmMap();
		
	}
	
	/**
	 * 创建外键-表实体映射图
	 */
	public void createFkmMap()
	{
		if(this.getFkmMap() == null)
		{
			this.setFkmMap(new HashMap());
		}
		MBean mBean = new MainMBean();
		this.addOneFkm("mainId",(MainMBean)mBean,"id");
		mBean = new OpTypeMBean();
		this.addOneFkm("opNo",(OpTypeMBean)mBean,"id");
		
	}
	
	/**
	 * 创建属性名-SubBean(为属性名-表字段名-字段值的复合数据类型)的映射
	 *
	 */
	public void createOrmMap()
	{
		HashMap ormMap = new HashMap();
		MBean.SubBean subBean = null;
		String pojoCol = null;
		String tableCol = null;
		
		
		//设置各属性名-表字段名-表字段值的映射,,其中tableCol表属性名设为“数据库表名+字段名”
		pojoCol = "id";
		tableCol = "APPLICATION.ID";
		subBean = this.initSubBean(this.getPojoName(),pojoCol,tableCol,null,null);
		ormMap.put(pojoCol,subBean);
		
		pojoCol = "mainId";
		tableCol = "APPLICATION.MAIN_ID";
		subBean = this.initSubBean(this.getPojoName(),pojoCol,tableCol,null,null);
		ormMap.put(pojoCol,subBean);
		
		pojoCol = "opNo";
		tableCol = "APPLICATION.OP_NO";
		subBean = this.initSubBean(this.getPojoName(),pojoCol,tableCol,null,null);
		ormMap.put(pojoCol,subBean);
		
		pojoCol = "sqls";
		tableCol = "APPLICATION.SQLS";
		subBean = this.initSubBean(this.getPojoName(),pojoCol,tableCol,null,null);
		ormMap.put(pojoCol,subBean);
		
		pojoCol = "tableName";
		tableCol = "APPLICATION.TABLE_NAME";
		subBean = this.initSubBean(this.getPojoName(),pojoCol,tableCol,null,null);
		ormMap.put(pojoCol,subBean);
		
		pojoCol = "recPk";
		tableCol = "APPLICATION.REC_PK";
		subBean = this.initSubBean(this.getPojoName(),pojoCol,tableCol,null,null);
		ormMap.put(pojoCol,subBean);
		
		pojoCol = "empId";
		tableCol = "APPLICATION.EMP_ID";
		subBean = this.initSubBean(this.getPojoName(),pojoCol,tableCol,null,null);
		ormMap.put(pojoCol,subBean);
		
		this.setOrmMap(ormMap);
				
		
	}


}

⌨️ 快捷键说明

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