struts2.2-jquery-plugin学習enetityエンティティとhbmファイル(3)

2858 ワード

(一)エンティティ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>