Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23418 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
import java.time.format.DateTimeFormatter;
6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
23880 ashik.ali 14
import javax.persistence.Transient;
23418 ashik.ali 15
 
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
17
 
18
@Entity
19
@Table(name="fofo.prebooking_listing", schema = "fofo")
20
public class PrebookingListing implements Serializable{
21
 
22
	private static final long serialVersionUID = 1L;
23
 
24
	@Id
25
	@Column(name = "id")
26
	@GeneratedValue(strategy = GenerationType.IDENTITY)
27
	private int id;
28
 
29
	@Column(name = "item_id")
30
	private int itemId;
31
 
24085 amit.gupta 32
	@Column(name = "catalog_id")
33
	private int catalogId;
34
 
23418 ashik.ali 35
	@Column(name = "advance_amount")
36
	private float advanceAmount;
37
 
38
	@Column(name = "tentative_amount")
39
	private float tentativeAmount;
40
 
41
	@Column(name = "created_by")
42
	private int createdBy;
43
 
44
	@Convert(converter = LocalDateTimeAttributeConverter.class)
45
	@Column(name = "active_timestamp")
46
	private LocalDateTime activeTimestamp = null;
47
 
48
	@Convert(converter = LocalDateTimeAttributeConverter.class)
49
	@Column(name = "expire_timestamp")
50
	private LocalDateTime expireTimestamp = null;
51
 
52
	@Convert(converter = LocalDateTimeAttributeConverter.class)
53
	@Column(name = "create_timestamp")
54
	private LocalDateTime createTimestamp = LocalDateTime.now();
23880 ashik.ali 55
 
56
	@Transient
57
	private String description;
23418 ashik.ali 58
 
59
	public int getId() {
60
		return id;
61
	}
62
 
63
	public void setId(int id) {
64
		this.id = id;
65
	}
24085 amit.gupta 66
 
67
 
23418 ashik.ali 68
 
24085 amit.gupta 69
	public int getCatalogId() {
70
		return catalogId;
71
	}
72
 
73
	public void setCatalogId(int catalogId) {
74
		this.catalogId = catalogId;
75
	}
76
 
23418 ashik.ali 77
	public int getItemId() {
78
		return itemId;
79
	}
80
 
81
	public void setItemId(int itemId) {
82
		this.itemId = itemId;
83
	}
84
 
85
	public float getAdvanceAmount() {
86
		return advanceAmount;
87
	}
88
 
89
	public void setAdvanceAmount(float advanceAmount) {
90
		this.advanceAmount = advanceAmount;
91
	}
92
 
93
	public float getTentativeAmount() {
94
		return tentativeAmount;
95
	}
96
 
97
	public void setTentativeAmount(float tentativeAmount) {
98
		this.tentativeAmount = tentativeAmount;
99
	}
100
 
101
	public int getCreatedBy() {
102
		return createdBy;
103
	}
104
 
105
	public void setCreatedBy(int createdBy) {
106
		this.createdBy = createdBy;
107
	}
108
 
109
	public LocalDateTime getActiveTimestamp() {
110
		return activeTimestamp;
111
	}
112
 
113
	public void setActiveTimestamp(LocalDateTime activeTimestamp) {
114
		this.activeTimestamp = activeTimestamp;
115
	}
116
 
117
	public LocalDateTime getExpireTimestamp() {
118
		return expireTimestamp;
119
	}
120
 
121
	public void setExpireTimestamp(LocalDateTime expireTimestamp) {
122
		this.expireTimestamp = expireTimestamp;
123
	}
124
 
125
	public LocalDateTime getCreateTimestamp() {
126
		return createTimestamp;
127
	}
128
 
129
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
130
		this.createTimestamp = createTimestamp;
131
	}
132
 
23880 ashik.ali 133
	public String getDescription() {
134
		return description;
135
	}
136
 
137
	public void setDescription(String description) {
138
		this.description = description;
139
	}
140
 
23418 ashik.ali 141
	public String getFormattedActiveTimestamp(){
142
		if(activeTimestamp == null){
143
			return null;
144
		}
145
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
146
		return activeTimestamp.format(formatter);
147
    }
148
 
149
	public String getFormattedExpireTimestamp(){
150
		if(expireTimestamp == null){
151
			return null;
152
		}
153
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
154
		return expireTimestamp.format(formatter);
155
    }
156
 
157
	public String getFormattedCreateTimestamp(){
158
		if(createTimestamp == null){
159
			return null;
160
		}
161
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
162
		return createTimestamp.format(formatter);
163
    }
164
 
165
	@Override
166
	public int hashCode() {
167
		final int prime = 31;
168
		int result = 1;
169
		result = prime * result + id;
170
		return result;
171
	}
172
 
173
	@Override
174
	public boolean equals(Object obj) {
175
		if (this == obj)
176
			return true;
177
		if (obj == null)
178
			return false;
179
		if (getClass() != obj.getClass())
180
			return false;
181
		PrebookingListing other = (PrebookingListing) obj;
182
		if (id != other.id)
183
			return false;
184
		return true;
185
	}
186
 
187
	@Override
188
	public String toString() {
24085 amit.gupta 189
		return "PrebookingListing [id=" + id + ", itemId=" + itemId + ", catalogId=" + catalogId + ", advanceAmount="
190
				+ advanceAmount + ", tentativeAmount=" + tentativeAmount + ", createdBy=" + createdBy
191
				+ ", activeTimestamp=" + activeTimestamp + ", expireTimestamp=" + expireTimestamp + ", createTimestamp="
192
				+ createTimestamp + ", description=" + description + "]";
23418 ashik.ali 193
	}
194
 
195
}