OSDN Git Service

クラス名が分りづらいので変更
[rabbit-bts/RabbitBTS.git] / src / jp / sourceforge / rabbitBTS / models / Account.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
18 package jp.sourceforge.rabbitBTS.models;
19
20 import java.util.Date;
21
22 import javax.jdo.annotations.IdGeneratorStrategy;
23 import javax.jdo.annotations.IdentityType;
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.Length;
29 import org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;
30
31 import com.google.appengine.api.users.User;
32
33 @PersistenceCapable(identityType = IdentityType.APPLICATION)
34 public class Account {
35         @PrimaryKey
36         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
37         private Long userProfileId;
38
39         // google user
40         @Persistent
41         private User gu;
42
43         /**
44          * 自己紹介
45          */
46         @Persistent
47         @NotBlank
48         @Length(max=255) // TODO:サロゲートありで満杯までいれると500byte越えるかもね。
49         private String bio;
50         
51         /**
52          * 最後にシステムにアクセスした日時
53          */
54         @Persistent
55         private Date lastAccess;
56
57         public Long getUserProfileId() {
58                 return userProfileId;
59         }
60
61         public User getGu() {
62                 return gu;
63         }
64
65         public Date getLastAccess() {
66                 return lastAccess;
67         }
68
69         public void setGu(User gu) {
70                 this.gu = gu;
71         }
72
73         public void setLastAccess(Date lastAccess) {
74                 this.lastAccess = lastAccess;
75         }
76
77         /**
78          * @return the bio
79          */
80         public String getBio() {
81                 return bio;
82         }
83
84         /**
85          * @param bio the bio to set
86          */
87         public void setBio(String bio) {
88                 this.bio = bio;
89         }
90 }