zoukankan      html  css  js  c++  java
  • javaWeb服务详解(含源代码,测试通过,注释) ——Dept实体类

    package org.entity;
    
    import java.util.HashSet;
    import java.util.Set;
    
    import javax.xml.bind.annotation.XmlTransient;
    
    /**
     * 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<Emp> emps = new HashSet<Emp>(0);
    
    	// Constructors
    
    	/** default constructor */
    	public Dept() {
    	}
    
    	/** minimal constructor */
    	public Dept(Integer deptno) {
    		this.deptno = deptno;
    	}
    
    	/** full constructor */
    	public Dept(Integer deptno, String dname, String loc, Set emps) {
    		this.deptno = deptno;
    		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;
    	}
    
    	@XmlTransient
    	public Set<Emp> getEmps() {
    		return emps;
    	}
    
    	public void setEmps(Set<Emp> emps) {
    		this.emps = emps;
    	}
    
    }

    Dept的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">
    <!-- 
        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="9" scale="0" />
                <generator class="assigned" />
            </id>
            <property name="dname" type="java.lang.String">
                <column name="DNAME" length="30" />
            </property>
            <property name="loc" type="java.lang.String">
                <column name="LOC" length="30" />
            </property>
            <set name="emps" inverse="true" >
                <key>
                    <column name="DEPTNO" precision="9" scale="0" />
                </key>
                <one-to-many class="org.entity.Emp" />
            </set>
        </class>
    </hibernate-mapping>
    


  • 相关阅读:
    序列——堆排序-大根堆(堆大顶)
    3 分钟的高速体验 Apache Spark SQL
    UVa 1401 Remember the Word
    leetcode
    oracle看到用户的所有表名、表睐、字段名称、现场的目光、是空的、字段类型
    cocos2d-x物业现场
    Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket
    ThreadPoolExecutor详解
    Java四种线程池newCachedThreadPool,newFixedThreadPool,newScheduledThreadPool,newSingleThreadExecutor
    A First Exploration Of SolrCloud
  • 原文地址:https://www.cnblogs.com/a1111/p/7459669.html
Copyright © 2011-2022 走看看