实体类:
Cartes.java
public class Cartes implements java.io.Serializable {
// Fields
private String cid;
private String cname;
private Integer type;
private Float price;
private String cremork;
private Set elists = new HashSet(0);
// Constructors
/** default constructor */
public Cartes() {
}
/** minimal constructor */
public Cartes(String cname, Integer type, Float price) {
this.cname = cname;
this.type = type;
this.price = price;
}
/** full constructor */
public Cartes(String cname, Integer type, Float price, String cremork,
Set elists) {
this.cname = cname;
this.type = type;
this.price = price;
this.cremork = cremork;
this.elists = elists;
}
// Property accessors
public String getCid() {
return this.cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getCname() {
return this.cname;
}
public void setCname(String cname) {
this.cname = cname;
}
public Integer getType() {
return this.type;
}
public void setType(Integer type) {
this.type = type;
}
public Float getPrice() {
return this.price;
}
public void setPrice(Float price) {
this.price = price;
}
public String getCremork() {
return this.cremork;
}
public void setCremork(String cremork) {
this.cremork = cremork;
}
public Set getElists() {
return this.elists;
}
public void setElists(Set elists) {
this.elists = elists;
}
}
Elist.java
public class Elist implements java.io.Serializable {
// Fields
private String eid;
private Cartes cartes;
private People people;
private Users users;
private Timestamp etime;
private Integer enum_;
// Constructors
/** default constructor */
public Elist() {
}
/** full constructor */
public Elist(Cartes cartes, People people, Users users, Timestamp etime,
Integer enum_) {
this.cartes = cartes;
this.people = people;
this.users = users;
this.etime = etime;
this.enum_ = enum_;
}
// Property accessors
public String getEid() {
return this.eid;
}
public void setEid(String eid) {
this.eid = eid;
}
public Cartes getCartes() {
return this.cartes;
}
public void setCartes(Cartes cartes) {
this.cartes = cartes;
}
public People getPeople() {
return this.people;
}
public void setPeople(People people) {
this.people = people;
}
public Users getUsers() {
return this.users;
}
public void setUsers(Users users) {
this.users = users;
}
public Timestamp getEtime() {
return this.etime;
}
public void setEtime(Timestamp etime) {
this.etime = etime;
}
public Integer getEnum_() {
return this.enum_;
}
public void setEnum_(Integer enum_) {
this.enum_ = enum_;
}
映射文件:
Cartes.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="com.eshop.entity.Cartes" table="cartes" catalog="eshop">
<id name="cid" type="java.lang.String">
<column name="cid" length="10" />
<generator class="native" />
</id>
<property name="cname" type="java.lang.String">
<column name="cname" length="20" not-null="true" />