@@ -0,0 +1,1826 @@
+import java.util.Date;%0A%0Aimport javax.persistence.CascadeType;%0Aimport javax.persistence.Column;%0Aimport javax.persistence.Entity;%0Aimport javax.persistence.GeneratedValue;%0Aimport javax.persistence.Id;%0Aimport javax.persistence.JoinColumn;%0Aimport javax.persistence.ManyToOne;%0Aimport javax.persistence.Temporal;%0Aimport javax.persistence.TemporalType;%0A/**%0A * %E5%91%98%E5%B7%A5%E7%95%99%E8%A8%80%0A *%0A */%0A@Entity%0Apublic class Message %7B%0A%09private Integer id;%0A%09private String content;%0A%09private Date createtime = new Date();%0A%09private String username;%0A%09private Order order;%0A%09%0A%09@ManyToOne(cascade=CascadeType.REFRESH)%0A%09@JoinColumn(name=%22order_id%22)%0A%09public Order getOrder() %7B%0A%09%09return order;%0A%09%7D%0A%09public void setOrder(Order order) %7B%0A%09%09this.order = order;%0A%09%7D%0A%09@Id @GeneratedValue%0A%09public Integer getId() %7B%0A%09%09return id;%0A%09%7D%0A%09public void setId(Integer id) %7B%0A%09%09this.id = id;%0A%09%7D%0A%09@Column(length=200,nullable=false)%0A%09public String getContent() %7B%0A%09%09return content;%0A%09%7D%0A%09public void setContent(String content) %7B%0A%09%09this.content = content;%0A%09%7D%0A%09@Temporal(TemporalType.TIMESTAMP)%0A%09public Date getCreatetime() %7B%0A%09%09return createtime;%0A%09%7D%0A%09public void setCreatetime(Date createtime) %7B%0A%09%09this.createtime = createtime;%0A%09%7D%0A%09@Column(length=20,nullable=false)%0A%09public String getUsername() %7B%0A%09%09return username;%0A%09%7D%0A%09public void setUsername(String username) %7B%0A%09%09this.username = username;%0A%09%7D%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09final int prime = 31;%0A%09%09int result = 1;%0A%09%09result = prime * result + ((id == null) ? 0 : id.hashCode());%0A%09%09return result;%0A%09%7D%0A%09@Override%0A%09public boolean equals(Object obj) %7B%0A%09%09if (this == obj)%0A%09%09%09return true;%0A%09%09if (obj == null)%0A%09%09%09return false;%0A%09%09if (getClass() != obj.getClass())%0A%09%09%09return false;%0A%09%09final Message other = (Message) obj;%0A%09%09if (id == null) %7B%0A%09%09%09if (other.id != null)%0A%09%09%09%09return false;%0A%09%09%7D else if (!id.equals(other.id))%0A%09%09%09return false;%0A%09%09return true;%0A%09%7D%0A%09%0A%7D%0A

Create Message.java