Subversion Repositories SmartDukaan

Rev

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