日期:2014-05-17 浏览次数:21016 次

可以根据数据库用myeclipse工具生成xxxx.hbm.xml文件,然后根据自己的需求在修改相关参数,可能需要你自己好好研究一下,这个一句两句真讲不清楚的,给你一个例子,你好好看看,这个是我自己的项目:package com.xingao.entity;
import java.util.HashSet;
import java.util.Set;
/**
* T_role entity. @author MyEclipse Persistence Tools
*/
public class T_role implements java.io.Serializable {
// Fields
private Integer id;
private W_user w_user;
private T_template t_template;
private String name;
private String duty;
private String description;
private Integer type;
private Set<T_node_role> t_node_roles = new HashSet<T_node_role>();
// Constructors
/** default constructor */
public T_role() {
}
/** minimal constructor */
public T_role(T_template t_template, String name) {
this.t_template = t_template;
this.name = name;
}
/** full constructor */
public T_role(W_user w_user, T_template t_template, String name, String duty, String description, Integer type, Set<T_node_role> t_node_roles) {
this.w_user = w_user;
this.t_template = t_template;
this.name = name;
this.duty = duty;
this.description = description;
this.type = type;
this.t_node_roles = t_node_roles;
}
// Property accessors
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public W_user getW_user() {
retu