Subversion Repositories SmartDukaan

Rev

Rev 22216 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22216 Rev 25651
Line 15... Line 15...
15
import org.hibernate.annotations.UpdateTimestamp;
15
import org.hibernate.annotations.UpdateTimestamp;
16
 
16
 
17
import com.spice.profitmandi.common.enumuration.ContentType;
17
import com.spice.profitmandi.common.enumuration.ContentType;
18
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
18
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
19
 
19
 
20
 
-
 
21
@Entity
20
@Entity
22
@Table(name="dtr.document", schema = "dtr")
21
@Table(name = "dtr.document", schema = "dtr")
23
public class Document{
22
public class Document {
24
 
23
 
25
	@Id
24
	@Id
26
	@Column(name="id", unique=true, updatable=false)
25
	@Column(name = "id", unique = true, updatable = false)
27
	@GeneratedValue(strategy = GenerationType.IDENTITY)
26
	@GeneratedValue(strategy = GenerationType.IDENTITY)
28
	private int id;
27
	private int id;
29
 
28
 
30
	@Column(name="name", unique = true)
29
	@Column(name = "name", unique = true)
31
	private String name;
30
	private String name;
32
 
31
 
33
	@Column(name = "path")
32
	@Column(name = "path")
34
	private String path;
33
	private String path;
35
 
34
 
Line 37... Line 36...
37
	@Enumerated(EnumType.STRING)
36
	@Enumerated(EnumType.STRING)
38
	private ContentType contentType;
37
	private ContentType contentType;
39
 
38
 
40
	private long size;
39
	private long size;
41
 
40
 
-
 
41
	@Column(name = "display_name")
-
 
42
	private String displayName;
-
 
43
 
-
 
44
	public String getDisplayName() {
-
 
45
		return displayName;
-
 
46
	}
-
 
47
 
-
 
48
	public void setDisplayName(String displayName) {
-
 
49
		this.displayName = displayName;
-
 
50
	}
-
 
51
 
42
	@Convert(converter = LocalDateTimeAttributeConverter.class)
52
	@Convert(converter = LocalDateTimeAttributeConverter.class)
43
	private LocalDateTime createTimestamp = LocalDateTime.now();
53
	private LocalDateTime createTimestamp = LocalDateTime.now();
44
 
54
 
45
	@Convert(converter = LocalDateTimeAttributeConverter.class)
55
	@Convert(converter = LocalDateTimeAttributeConverter.class)
46
	@UpdateTimestamp
56
	@UpdateTimestamp
47
	private LocalDateTime updateTimestamp = LocalDateTime.now();
57
	private LocalDateTime updateTimestamp = LocalDateTime.now();
48
	
58
 
49
	@Column(columnDefinition="tinyint(1) default 0")
59
	@Column(columnDefinition = "tinyint(1) default 0")
50
	private boolean persisted;
60
	private boolean persisted;
51
 
61
 
52
	public int getId() {
62
	public int getId() {
53
		return id;
63
		return id;
54
	}
64
	}
Line 103... Line 113...
103
 
113
 
104
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
114
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
105
		this.updateTimestamp = updateTimestamp;
115
		this.updateTimestamp = updateTimestamp;
106
	}
116
	}
107
 
117
 
108
 
-
 
109
	public boolean isPersisted() {
118
	public boolean isPersisted() {
110
		return persisted;
119
		return persisted;
111
	}
120
	}
112
 
121
 
113
	public void setPersisted(boolean persisted) {
122
	public void setPersisted(boolean persisted) {
114
		this.persisted = persisted;
123
		this.persisted = persisted;
115
	}
124
	}
116
 
125
 
117
	
-
 
118
 
-
 
119
	@Override
126
	@Override
120
	public int hashCode() {
127
	public int hashCode() {
121
		final int prime = 31;
128
		final int prime = 31;
122
		int result = 1;
129
		int result = 1;
123
		result = prime * result + id;
130
		result = prime * result + id;
Line 139... Line 146...
139
	}
146
	}
140
 
147
 
141
	@Override
148
	@Override
142
	public String toString() {
149
	public String toString() {
143
		return "Document [id=" + id + ", name=" + name + ", path=" + path + ", contentType=" + contentType + ", size="
150
		return "Document [id=" + id + ", name=" + name + ", path=" + path + ", contentType=" + contentType + ", size="
144
				+ size + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp
151
				+ size + ", displayName=" + displayName + ", createTimestamp=" + createTimestamp + ", updateTimestamp="
145
				+ ", persisted=" + persisted + "]";
152
				+ updateTimestamp + ", persisted=" + persisted + "]";
146
	}
153
	}
147
	
-
 
148
	
-
 
149
 
154
 
150
}
155
}
151
156