BrightSide Workbench Full Report + Source Code
Role.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 javax.persistence.Column;
21 import javax.persistence.Entity;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.Id;
24 import javax.persistence.JoinColumn;
25 import javax.persistence.ManyToOne;
26 import org.zkoss.lang.Strings;
27 
28 @Entity(name="CONTACT_ROLE")
29 @org.hibernate.annotations.GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
30 public class Role implements java.io.Serializable {
31 
32  @Id
33  @GeneratedValue(generator = "hibernate-uuid")
34  @Column(name="IDENTIFIER")
35  private String id;
36 
37  private String owner;
38 
39  private boolean onlyOwner;
40 
41  @Column(name="ROLE_NAME")
42  private String name;
43 
44  @ManyToOne
45  @JoinColumn(name="CONTACT_FK")
46  private org.turro.contacts.Contact contact;
47 
48  public String getId() {
49  return id;
50  }
51 
52  protected void setId(String id) {
53  this.id = id;
54  }
55 
56  public String getOwner() {
57  return owner;
58  }
59 
60  public void setOwner(String owner) {
61  this.owner = owner;
62  }
63 
64  public boolean isOnlyOwner() {
65  return onlyOwner;
66  }
67 
68  public void setOnlyOwner(boolean onlyOwner) {
69  this.onlyOwner = onlyOwner;
70  }
71 
72  public String getName() {
73  return name;
74  }
75 
76  public void setName(String name) {
77  this.name = name;
78  }
79 
80  public org.turro.contacts.Contact getContact() {
81  return contact;
82  }
83 
84  public void setContact(org.turro.contacts.Contact contact) {
85  this.contact = contact;
86  }
87 
88  public boolean getCanShow(String userId) {
89  return true;
90  }
91 
92  public boolean isEmpty() {
93  return Strings.isEmpty(name);
94  }
95 
96 }
boolean isEmpty()
Definition: Role.java:92
boolean isOnlyOwner()
Definition: Role.java:64
org.turro.contacts.Contact getContact()
Definition: Role.java:80
void setOnlyOwner(boolean onlyOwner)
Definition: Role.java:68
void setId(String id)
Definition: Role.java:52
void setContact(org.turro.contacts.Contact contact)
Definition: Role.java:84
void setOwner(String owner)
Definition: Role.java:60
boolean getCanShow(String userId)
Definition: Role.java:88
void setName(String name)
Definition: Role.java:76