`

struts2.2-jquery-plugin学习enetity实体和hbm文件(三)

阅读更多

(一)实体been:

package com.newsicom.jxc.basicInfo.common.model;

public class GoodsUnits {
	private Integer id;//ID
	private String cd;//编码
	private String name;//名称
	private String byname;//别名
	private String memCode;//助记符
	private String memo;//备注
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getCd() {
		return cd;
	}
	public void setCd(String cd) {
		this.cd = cd;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getByname() {
		return byname;
	}
	public void setByname(String byname) {
		this.byname = byname;
	}
	public String getMemCode() {
		return memCode;
	}
	public void setMemCode(String memCode) {
		this.memCode = memCode;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	
}

 (二)hbm.xml映射文件:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.newsicom.jxc.basicInfo.common.model.GoodsUnits" table="tbl_goods_units" catalog="classicmodels">
        <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator class="native" />
        </id>
        <property name="cd" type="java.lang.String">
            <column name="cd" length="32" />
        </property>
        <property name="name" type="java.lang.String">
            <column name="name" length="128" />
        </property>
        <property name="byname" type="java.lang.String">
            <column name="byname" length="128" />
        </property>
        <property name="memCode" type="java.lang.String">
            <column name="mem_code" length="32" />
        </property>
         <property name="memo" type="java.lang.String">
            <column name="memo" length="100" />
        </property>
    </class>
</hibernate-mapping>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics