zoukankan      html  css  js  c++  java
  • struts+hibernate+oracle+easyui实现lazyout组件的简单案例——Dept实体类和对应的配置信息

        现在请大家看看Dept的实体类和对应的映射信息:

    Dept实体类

    package org.entity;
    
    import java.util.HashSet;
    import java.util.Set;
    
    /**
     * Dept entity. @author MyEclipse Persistence Tools
     */
    
    public class Dept implements java.io.Serializable {
    
    	// Fields
    
    	private Integer deptno;
    	private String dname;
    	private String loc;
    	private Set emps = new HashSet(0);
    
    	// Constructors
    
    	/** default constructor */
    	public Dept() {
    	}
    
    	/** full constructor */
    	public Dept(String dname, String loc, Set emps) {
    		this.dname = dname;
    		this.loc = loc;
    		this.emps = emps;
    	}
    
    	// Property accessors
    
    	public Integer getDeptno() {
    		return this.deptno;
    	}
    
    	public void setDeptno(Integer deptno) {
    		this.deptno = deptno;
    	}
    
    	public String getDname() {
    		return this.dname;
    	}
    
    	public void setDname(String dname) {
    		this.dname = dname;
    	}
    
    	public String getLoc() {
    		return this.loc;
    	}
    
    	public void setLoc(String loc) {
    		this.loc = loc;
    	}
    
    	public Set getEmps() {
    		return this.emps;
    	}
    
    	public void setEmps(Set emps) {
    		this.emps = emps;
    	}
    
    }

    对应的是Dept.hbm信息

    <?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">
    <!-- 
        Mapping file autogenerated by MyEclipse Persistence Tools
    -->
    <hibernate-mapping>
        <class name="org.entity.Dept" table="DEPT" schema="PRO">
            <id name="deptno" type="java.lang.Integer">
                <column name="DEPTNO" precision="6" scale="0" />
                <generator class="native" />
            </id>
            <property name="dname" type="java.lang.String">
                <column name="DNAME" length="14" />
            </property>
            <property name="loc" type="java.lang.String">
                <column name="LOC" length="13" />
            </property>
            <set name="emps" inverse="true">
                <key>
                    <column name="DEPTNO" precision="6" scale="0" />
                </key>
                <one-to-many class="org.entity.Emp" />
            </set>
        </class>
    </hibernate-mapping>
    


  • 相关阅读:
    .Net基础:CLR基本原理
    行业软件开发商怎样来抢 BI 这块蛋糕?
    免费报表工具知多少?
    哪款报表工具更适合行业软件开发商?
    报表如何通过参数控制数据权限
    实现报表滚动到底部翻页效果
    报表 BI 选型的那些事
    零编码制作报表可能吗?
    为什么说当前报表开发的工作量主要在数据源环节?又如何解决呢?
    用存储过程和 JAVA 写报表数据源有什么弊端?
  • 原文地址:https://www.cnblogs.com/a1111/p/7459731.html
Copyright © 2011-2022 走看看