001: package app.data;
002:
003: import java.sql.Timestamp;
004: import java.util.List;
005: import javax.persistence.Entity;
006: import javax.persistence.Id;
007: import javax.persistence.Lob;
008: import javax.persistence.ManyToOne;
009: import javax.persistence.OneToMany;
010: import javax.persistence.Table;
011: import javax.persistence.Version;
012:
013: /**
014: * Topic entity bean.
015: */
016: @Entity
017: @Table(name="f_topic")
018: public class Topic {
019:
020: @Id
021: Integer id;
022:
023: String title;
024:
025: @Lob
026: String body;
027:
028: Integer postCount;
029:
030: Timestamp cretime;
031:
032: @Version
033: Timestamp updtime;
034:
035: @ManyToOne
036: User user;
037:
038: @ManyToOne
039: Forum forum;
040:
041: @OneToMany
042: List<TopicPost> posts;
043:
044: /**
045: * Return id.
046: */
047: public Integer getId() {
048: return id;
049: }
050:
051: /**
052: * Set id.
053: */
054: public void setId(Integer id) {
055: this .id = id;
056: }
057:
058: /**
059: * Return title.
060: */
061: public String getTitle() {
062: return title;
063: }
064:
065: /**
066: * Set title.
067: */
068: public void setTitle(String title) {
069: this .title = title;
070: }
071:
072: /**
073: * Return body.
074: */
075: public String getBody() {
076: return body;
077: }
078:
079: /**
080: * Set body.
081: */
082: public void setBody(String body) {
083: this .body = body;
084: }
085:
086: /**
087: * Return post count.
088: */
089: public Integer getPostCount() {
090: return postCount;
091: }
092:
093: /**
094: * Set post count.
095: */
096: public void setPostCount(Integer postCount) {
097: this .postCount = postCount;
098: }
099:
100: /**
101: * Return cretime.
102: */
103: public Timestamp getCretime() {
104: return cretime;
105: }
106:
107: /**
108: * Set cretime.
109: */
110: public void setCretime(Timestamp cretime) {
111: this .cretime = cretime;
112: }
113:
114: /**
115: * Return updtime.
116: */
117: public Timestamp getUpdtime() {
118: return updtime;
119: }
120:
121: /**
122: * Set updtime.
123: */
124: public void setUpdtime(Timestamp updtime) {
125: this .updtime = updtime;
126: }
127:
128: /**
129: * Return user.
130: */
131: public User getUser() {
132: return user;
133: }
134:
135: /**
136: * Set user.
137: */
138: public void setUser(User user) {
139: this .user = user;
140: }
141:
142: /**
143: * Return forum.
144: */
145: public Forum getForum() {
146: return forum;
147: }
148:
149: /**
150: * Set forum.
151: */
152: public void setForum(Forum forum) {
153: this .forum = forum;
154: }
155:
156: /**
157: * Return posts.
158: */
159: public List<TopicPost> getPosts() {
160: return posts;
161: }
162:
163: /**
164: * Set posts.
165: */
166: public void setPosts(List<TopicPost> posts) {
167: this.posts = posts;
168: }
169:
170: }
|