fix
Leonardo Vannucci
2018-09-17 f3b5366c32416d5e516048ad1b8ab7a78ac0f54d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
package it.digione.dg1cloud.model;
 
import java.io.Serializable;
import java.util.Date;
 
import javax.persistence.*;
 
/**
 * The persistent class for the reg_classification database table.
 * 
 */
@Entity
@Table(name="reg_document")
@Cacheable(false)
@SequenceGenerator(name="reg_document_seq", sequenceName="reg_document_seq", allocationSize=1 )
public class RegDocument implements Serializable {
 
   private static final long serialVersionUID = -3682129109212204091L;
   
   @Id 
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="reg_document_seq")
   @Column(name="document_id")
   private Long documentId;
   
   @Temporal(TemporalType.TIMESTAMP)
   private Date created;
   
   @Column(name="createdby")
   private String createdBy;
   
   @Temporal(TemporalType.TIMESTAMP)
   private Date modified;
   
   @Column(name="modifiedby")
   private String modifiedBy;
 
   @Column(name="file_hash")
   private String fileHash;
   
   @Column(name="file_name")
   private String fileName;
   
   @Column(name="file_path")
   private String filePath;
   
   @Column(name="file_size")
   private Long fileSize;
   
   @Temporal(TemporalType.TIMESTAMP)
   @Column(name="due_date")
   private Date dueDate;
   
   @Column(name="secret_key")
   private String secretKey;
   
   public RegDocument() {
   }
   
   @PrePersist
   public void prePersist() {
       Date now = new Date();
       if(created == null) //We set default value in case if the value is not set yet.
           created = now; 
       if(modified == null) //We set default value in case if the value is not set yet.
           modified = now;
   }
 
   public Long getDocumentId() {
       return documentId;
   }
 
   public void setDocumentId(Long documentId) {
       this.documentId = documentId;
   }
 
   public Date getCreated() {
       return created;
   }
 
   public void setCreated(Date created) {
       this.created = created;
   }
 
   public String getCreatedBy() {
       return createdBy;
   }
 
   public void setCreatedBy(String createdBy) {
       this.createdBy = createdBy;
   }
 
   public Date getModified() {
       return modified;
   }
 
   public void setModified(Date modified) {
       this.modified = modified;
   }
 
   public String getModifiedBy() {
       return modifiedBy;
   }
 
   public void setModifiedBy(String modifiedBy) {
       this.modifiedBy = modifiedBy;
   }
 
   public String getFileHash() {
       return fileHash;
   }
 
   public void setFileHash(String fileHash) {
       this.fileHash = fileHash;
   }
 
   public String getFileName() {
       return fileName;
   }
 
   public void setFileName(String fileName) {
       this.fileName = fileName;
   }
 
   public String getFilePath() {
       return filePath;
   }
 
   public void setFilePath(String filePath) {
       this.filePath = filePath;
   }
 
   public Long getFileSize() {
       return fileSize;
   }
 
   public void setFileSize(Long fileSize) {
       this.fileSize = fileSize;
   }
   
   public Date getDueDate() {
       return dueDate;
   }
 
   public void setDueDate(Date dueDate) {
       this.dueDate = dueDate;
   }
 
   public String getSecretKey() {
       return secretKey;
   }
 
   public void setSecretKey(String secretKey) {
       this.secretKey = secretKey;
   }
 
   @Override
   public String toString() {
       return "RegDocument [documentId=" + documentId + ", created=" + created + ", createdBy=" + createdBy
               + ", modified=" + modified + ", modifiedBy=" + modifiedBy + ", fileHash=" + fileHash + ", filePath="
               + filePath + ", fileSize=" + fileSize + ", dueDate=" + dueDate + "]";
   }
   
}