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

📄 main.java

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

import cn.edu.buaa.ieguam.logmanage.Pojo;
import java.sql.Date;

public class Main implements Pojo {

	private Integer id = null;
	private String logTypeNo = null;
	private Date timeStamp = null;
	private String usr = null;
	private String realName = null;
	private String ipAddress = null;
	private String source = null;
	
	
	
	public Integer getId()
	{
		return this.id;
	}
	public void setId(String id)
	{
		this.id = new Integer(id);
	}
	
	public String getLogTypeNo()
	{
		return this.logTypeNo;
	}
	public void setLogTypeNo(String logTypeNo)
	{
		this.logTypeNo = logTypeNo;
	}
	
	public Date getTimeStamp()
	{
		return this.timeStamp;
	}
	
/**
	public void setTimeStamp(String timeStamp)
	{
		this.timeStamp = ;
	}
*/	
	public String getUsr()
	{
		return this.usr;
	}
	public void setUsr(String usr)
	{
		this.usr = usr;
	}
	
	public String getRealName()
	{
		return this.realName;
	}
	public void setRealName(String realName)
	{
		this.realName = realName;
	}
	
	public String getIpAddress()
	{
		return this.ipAddress;
	}
	public void setIpAddress(String ipAddress)
	{
		this.ipAddress = ipAddress;
	}
	
	public String getSource()
	{
		return this.source;
	}
	public void setSource(String source)
	{
		this.source = source;
	}
	
	/**
	 * 根据属性名获得属性值
	 * @param colName
	 * @return
	 */
	public Object getColValue(String colName)
	{
		if(colName.equals("id"))
		{
			return this.getId();
		}
		
		if(colName.equals("logTypeNo"))
		{
			return this.getLogTypeNo();
		}
		
		if(colName.equals("timeStamp"))
		{
			return this.getTimeStamp();
		}
		
		if(colName.equals("usr"))
		{
			return this.getUsr();
		}
		
		if(colName.equals("realName"))
		{
			return this.getRealName();
		}
		
		if(colName.equals("ipAddress"))
		{
			return this.getIpAddress();
		}
		
		if(colName.equals("source"))
		{
			return this.getSource();
		}
		
		
		return null;
	}
	
	/**
	 * 设置属性名对应的属性值
	 * @param colName
	 * @param value
	 */
	public void setColValue(String colName,Object value)
	{
		if(value==null)
		{
			return;
		}
		if(value.toString().equals("null"))
		{
			return;
		}
		if(value.toString().trim().equals(""))
		{
			return;
			
		}
	    
	  try
	  {
		if(colName.equals("id"))
		{
			this.setId(value.toString());
		}
		
		if(colName.equals("logTypeNo"))
		{
			this.setLogTypeNo(value.toString());
		}
	/**
		if(colName.equals("timeStamp"))
		{
			this.setTimeStamp(value.toString());
		}
	*/	
		if(colName.equals("usr"))
		{
			this.setUsr(value.toString());
		}
		
		if(colName.equals("realName"))
		{
			this.setRealName(value.toString());
		}
		
		if(colName.equals("ipAddress"))
		{
			this.setIpAddress(value.toString());
		}
		
		if(colName.equals("source"))
		{
			this.setSource(value.toString());
		}
		
	  }catch(Exception c)
	  {
		   //System.out.println(c.getStackTrace());
		   System.out.println("对Main型Pojo的属性进行非法赋值报错!");
	  }
	}

}

⌨️ 快捷键说明

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