BrightSide Workbench Full Report + Source Code
Comment.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 package org.turro.contacts ;
19 
20 import java.util.Date;
21 import javax.persistence.*;
22 import org.turro.string.Strings;
23 import org.turro.jpa.entity.IDaoEntity;
24 
25 @Entity
26 @org.hibernate.annotations.GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
27 public class Comment implements java.io.Serializable, IDaoEntity {
28 
29  @Id
30  @GeneratedValue(generator = "hibernate-uuid")
31  @Column(name="IDENTIFIER")
32  private String id;
33 
34  private String owner;
35 
36  private boolean onlyOwner;
37 
38  @Temporal(value = TemporalType.TIMESTAMP)
39  private java.util.Date modification;
40 
41  @Lob
42  @Column(length=4096)
43  private String comment;
44 
45  @ManyToOne
46  @JoinColumn(name="CONTACT_FK")
47  private Contact contact;
48 
49  public String getId() {
50  return id;
51  }
52 
53  protected void setId(String id) {
54  this.id = id;
55  }
56 
57  public String getOwner() {
58  return owner;
59  }
60 
61  public void setOwner(String owner) {
62  this.owner = owner;
63  }
64 
65  public boolean isOnlyOwner() {
66  return onlyOwner;
67  }
68 
69  public void setOnlyOwner(boolean onlyOwner) {
70  this.onlyOwner = onlyOwner;
71  }
72 
73  public Date getModification() {
74  return modification;
75  }
76 
77  public void setModification(Date modification) {
78  this.modification = modification;
79  }
80 
81  public String getComment() {
82  return comment;
83  }
84 
85  public void setComment(String comment) {
86  this.comment = comment;
87  }
88 
89  public Contact getContact() {
90  return contact;
91  }
92 
93  public void setContact(Contact contact) {
94  this.contact = contact;
95  }
96 
97  public boolean getCanShow(String userId) {
98  return true;
99  }
100 
101  /* IDaoEntity */
102 
103  @Override
104  public Object entityId() {
105  return id;
106  }
107 
108  @Override
109  public boolean isEmpty() {
110  return Strings.isBlank(comment);
111  }
112 
113 }
boolean getCanShow(String userId)
Definition: Comment.java:97
void setContact(Contact contact)
Definition: Comment.java:93
void setOnlyOwner(boolean onlyOwner)
Definition: Comment.java:69
void setOwner(String owner)
Definition: Comment.java:61
void setComment(String comment)
Definition: Comment.java:85
void setModification(Date modification)
Definition: Comment.java:77
void setId(String id)
Definition: Comment.java:53