Statistics
| Branch: | Tag: | Revision:

root / src / org / gss_project / gss / server / domain / FileUploadStatus.java @ 1206:292dec4eae08

History | View | Annotate | Download (3 kB)

1
/*
2
 * Copyright 2009 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
6
 * GSS is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * GSS is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with GSS.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19
package org.gss_project.gss.server.domain;
20

    
21
import java.io.Serializable;
22

    
23
import javax.persistence.Column;
24
import javax.persistence.Entity;
25
import javax.persistence.GeneratedValue;
26
import javax.persistence.Id;
27
import javax.persistence.JoinColumn;
28
import javax.persistence.ManyToOne;
29
import javax.persistence.Table;
30
import javax.persistence.UniqueConstraint;
31

    
32
import org.hibernate.annotations.Cache;
33
import org.hibernate.annotations.CacheConcurrencyStrategy;
34

    
35

    
36
/**
37
 * @author kman
38
 *
39
 */
40
@Entity
41
@Table(uniqueConstraints = @UniqueConstraint(columnNames = {"owner_id", "filename"}))
42
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
43
public class FileUploadStatus implements Serializable{
44

    
45
        /**
46
         * The persistence ID of the object.
47
         */
48
        @Id
49
        @GeneratedValue
50
        private Long id;
51

    
52
        /**
53
         * The owner of this file.
54
         */
55
        @ManyToOne(optional=false)
56
        @JoinColumn(name="owner_id", nullable=false)
57
        private User owner;
58

    
59
        @Column(name="filename", nullable=false)
60
        private String filename;
61

    
62
        private Long bytesUploaded;
63

    
64
        private Long fileSize;
65

    
66
        /**
67
         * Retrieve the id.
68
         *
69
         * @return the id
70
         */
71
        public Long getId() {
72
                return id;
73
        }
74

    
75
        /**
76
         * Modify the id.
77
         *
78
         * @param anId the id to set
79
         */
80
        public void setId(Long anId) {
81
                id = anId;
82
        }
83

    
84
        /**
85
         * Retrieve the owner.
86
         *
87
         * @return the owner
88
         */
89
        public User getOwner() {
90
                return owner;
91
        }
92

    
93
        /**
94
         * Modify the owner.
95
         *
96
         * @param anOwner the owner to set
97
         */
98
        public void setOwner(User anOwner) {
99
                owner = anOwner;
100
        }
101

    
102
        /**
103
         * Retrieve the filename.
104
         *
105
         * @return the filename
106
         */
107
        public String getFilename() {
108
                return filename;
109
        }
110

    
111
        /**
112
         * Modify the filename.
113
         *
114
         * @param aFilename the filename to set
115
         */
116
        public void setFilename(String aFilename) {
117
                filename = aFilename;
118
        }
119

    
120
        /**
121
         * Retrieve the bytesUploaded.
122
         *
123
         * @return the bytesUploaded
124
         */
125
        public Long getBytesUploaded() {
126
                return bytesUploaded;
127
        }
128

    
129
        /**
130
         * Modify the bytesUploaded.
131
         *
132
         * @param theBytesUploaded the bytesUploaded to set
133
         */
134
        public void setBytesUploaded(Long theBytesUploaded) {
135
                bytesUploaded = theBytesUploaded;
136
        }
137

    
138
        /**
139
         * Retrieve the fileSize.
140
         *
141
         * @return the fileSize
142
         */
143
        public Long getFileSize() {
144
                return fileSize;
145
        }
146

    
147
        /**
148
         * Modify the fileSize.
149
         *
150
         * @param aFileSize the fileSize to set
151
         */
152
        public void setFileSize(Long aFileSize) {
153
                fileSize = aFileSize;
154
        }
155
}