BrightSide Workbench Full Report + Source Code
DescriptorValue.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2016 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 
19 package org.turro.dossier.entity;
20 
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.GenerationType;
25 import javax.persistence.Id;
26 import javax.persistence.Lob;
27 import javax.persistence.ManyToOne;
28 import org.turro.string.Strings;
29 import org.turro.jpa.entity.IDaoEntity;
30 
35 @Entity
36 public class DescriptorValue implements java.io.Serializable, IDaoEntity {
37 
38  @Id
39  @GeneratedValue(strategy=GenerationType.IDENTITY)
40  @Column(name="IDENTIFIER")
41  private Long id;
42 
43  @ManyToOne
44  private DescriptorDefinition descriptorDefinition;
45 
46  @Lob
47  @Column(length=4096)
48  private String text;
49 
50  @Lob
51  @Column(length=4096)
52  private String wiki;
53 
54  @ManyToOne
55  private Dossier dossier;
56 
57  public Long getId() {
58  return id;
59  }
60 
61  public void setId(Long id) {
62  this.id = id;
63  }
64 
66  return descriptorDefinition;
67  }
68 
69  public void setDescriptorDefinition(DescriptorDefinition descriptorDefinition) {
70  this.descriptorDefinition = descriptorDefinition;
71  }
72 
73  public String getText() {
74  return text;
75  }
76 
77  public void setText(String text) {
78  this.text = text;
79  }
80 
81  public String getWiki() {
82  return wiki;
83  }
84 
85  public void setWiki(String wiki) {
86  this.wiki = wiki;
87  }
88 
89  public Dossier getDossier() {
90  return dossier;
91  }
92 
93  public void setDossier(Dossier dossier) {
94  this.dossier = dossier;
95  }
96 
97  /* IDaoEntity */
98 
99  @Override
100  public Object entityId() {
101  return id;
102  }
103 
104  @Override
105  public boolean isEmpty() {
106  return Strings.isBlank(wiki);
107  }
108 
109 }
DescriptorDefinition getDescriptorDefinition()
void setDescriptorDefinition(DescriptorDefinition descriptorDefinition)