Subversion Repositories SmartDukaan

Rev

Rev 21924 | Rev 22125 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21720 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
21545 ashik.ali 2
 
3
import java.time.LocalDateTime;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Convert;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
 
15
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
21720 ashik.ali 16
import com.spice.profitmandi.dao.enumuration.dtr.ContentType;
21545 ashik.ali 17
 
18
 
19
@Entity
21596 ashik.ali 20
@Table(name="dtr.document", schema = "dtr")
21545 ashik.ali 21
public class Document{
22
 
23
	@Id
24
	@Column(name="id", unique=true, updatable=false)
25
	@GeneratedValue(strategy = GenerationType.IDENTITY)
26
	private int id;
27
 
28
	@Column(name="name", unique = true)
29
	private String name;
30
 
31
	@Column(name = "path")
32
	private String path;
33
 
34
	@Column(name = "content_type")
35
	@Enumerated(EnumType.STRING)
36
	private ContentType contentType;
37
 
38
	private long size;
39
 
40
	@Convert(converter = LocalDateTimeAttributeConverter.class)
41
	private LocalDateTime createTimestamp;
42
 
43
	@Convert(converter = LocalDateTimeAttributeConverter.class)
44
	private LocalDateTime updateTimestamp;
45
 
46
	@Column(columnDefinition="tinyint(1) default 0")
47
	private boolean persisted;
48
 
49
	public int getId() {
50
		return id;
51
	}
52
 
53
	public void setId(int id) {
54
		this.id = id;
55
	}
56
 
57
	public String getName() {
58
		return name;
59
	}
60
 
61
	public void setName(String name) {
62
		this.name = name;
63
	}
64
 
65
	public String getPath() {
66
		return path;
67
	}
68
 
69
	public void setPath(String path) {
70
		this.path = path;
71
	}
72
 
73
	public ContentType getContentType() {
74
		return contentType;
75
	}
76
 
77
	public void setContentType(ContentType contentType) {
78
		this.contentType = contentType;
79
	}
80
 
81
	public long getSize() {
82
		return size;
83
	}
84
 
85
	public void setSize(long size) {
86
		this.size = size;
87
	}
88
 
89
	public LocalDateTime getCreateTimestamp() {
90
		return createTimestamp;
91
	}
92
 
93
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
94
		this.createTimestamp = createTimestamp;
95
	}
96
 
97
	public LocalDateTime getUpdateTimestamp() {
98
		return updateTimestamp;
99
	}
100
 
101
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
102
		this.updateTimestamp = updateTimestamp;
103
	}
104
 
105
 
106
	public boolean isPersisted() {
107
		return persisted;
108
	}
109
 
110
	public void setPersisted(boolean persisted) {
111
		this.persisted = persisted;
112
	}
113
 
21924 ashik.ali 114
 
22009 ashik.ali 115
 
21602 ashik.ali 116
	@Override
21924 ashik.ali 117
	public int hashCode() {
118
		final int prime = 31;
119
		int result = 1;
120
		result = prime * result + id;
121
		return result;
122
	}
123
 
124
	@Override
125
	public boolean equals(Object obj) {
126
		if (this == obj)
127
			return true;
128
		if (obj == null)
129
			return false;
130
		if (getClass() != obj.getClass())
131
			return false;
132
		Document other = (Document) obj;
133
		if (id != other.id)
134
			return false;
135
		return true;
136
	}
137
 
138
	@Override
21602 ashik.ali 139
	public String toString() {
140
		return "Document [id=" + id + ", name=" + name + ", path=" + path + ", contentType=" + contentType + ", size="
141
				+ size + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp
142
				+ ", persisted=" + persisted + "]";
143
	}
144
 
145
 
146
 
21545 ashik.ali 147
}