OSDN Git Service

エンティティからgoogleのUserを切り離し。emailで一意性を確保。
[rabbit-bts/RabbitBTS.git] / src / jp / sourceforge / rabbitBTS / models / BbsPost.java
1 /*
2    Copyright 2009 senju@users.sourceforge.jp
3
4    Licensed under the Apache License, Version 2.0 (the "License");
5    you may not use this file except in compliance with the License.
6    You may obtain a copy of the License at
7
8        http://www.apache.org/licenses/LICENSE-2.0
9
10    Unless required by applicable law or agreed to in writing, software
11    distributed under the License is distributed on an "AS IS" BASIS,
12    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    See the License for the specific language governing permissions and
14    limitations under the License.
15  */
16
17 package jp.sourceforge.rabbitBTS.models;
18
19 import java.util.Date;
20
21 import javax.jdo.annotations.IdGeneratorStrategy;
22 import javax.jdo.annotations.IdentityType;
23 import javax.jdo.annotations.NotPersistent;
24 import javax.jdo.annotations.PersistenceCapable;
25 import javax.jdo.annotations.Persistent;
26 import javax.jdo.annotations.PrimaryKey;
27
28 import org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;
29
30 @PersistenceCapable(identityType = IdentityType.APPLICATION)
31 public class BbsPost {
32         @PrimaryKey
33         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
34         private Long id;
35         @Persistent
36         private Long authorId;
37         @Persistent
38         @NotBlank
39         private String content;
40         @Persistent
41         private Date date;
42         @NotPersistent
43         private Account author;
44
45         public BbsPost() {
46
47         }
48
49         public BbsPost(Long author, String content, Date date) {
50                 this.authorId = author;
51                 this.content = content;
52                 this.date = date;
53         }
54
55         public Long getId() {
56                 return this.id;
57         }
58
59         public String getContent() {
60                 return this.content;
61         }
62
63         public Date getDate() {
64                 return this.date;
65         }
66
67         public void setContent(String content) {
68                 this.content = content;
69         }
70
71         public void setDate(Date date) {
72                 this.date = date;
73         }
74
75         /**
76          * @return the authorId
77          */
78         public Long getAuthorId() {
79                 return this.authorId;
80         }
81
82         /**
83          * @param authorId
84          *            the authorId to set
85          */
86         public void setAuthorId(Long author) {
87                 this.authorId = author;
88         }
89
90         /**
91          * @return the author
92          */
93         public Account getAuthor() {
94                 return this.author;
95         }
96
97         /**
98          * @param author
99          *            the author to set
100          */
101         public void setAuthor(Account author) {
102                 this.author = author;
103         }
104 }