package com.lst.lc.entities; // Generated 2015-8-25 20:56:56 by Hibernate Tools 4.3.1 import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * Letter generated by hbm2java */ @Entity @Table(name = "letter", catalog = "LearningCommunity") public class Letter implements java.io.Serializable { private LetterId id; private User userByToUid; private User userByFromUid; private String content; private int state; public Letter() { } public Letter(LetterId id, User userByToUid, User userByFromUid, String content, int state) { this.id = id; this.userByToUid = userByToUid; this.userByFromUid = userByFromUid; this.content = content; this.state = state; } @EmbeddedId @AttributeOverrides({ @AttributeOverride(name = "fromUid", column = @Column(name = "fromUid", nullable = false)), @AttributeOverride(name = "toUid", column = @Column(name = "toUid", nullable = false)), @AttributeOverride(name = "time", column = @Column(name = "time", nullable = false, length = 50)) }) public LetterId getId() { return this.id; } public void setId(LetterId id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "toUid", nullable = false, insertable = false, updatable = false) public User getUserByToUid() { return this.userByToUid; } public void setUserByToUid(User userByToUid) { this.userByToUid = userByToUid; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "fromUid", nullable = false, insertable = false, updatable = false) public User getUserByFromUid() { return this.userByFromUid; } public void setUserByFromUid(User userByFromUid) { this.userByFromUid = userByFromUid; } @Column(name = "content", nullable = false, length = 65535) public String getContent() { return this.content; } public void setContent(String content) { this.content = content; } @Column(name = "state", nullable = false) public int getState() { return this.state; } public void setState(int state) { this.state = state; } }