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