Subversion Repositories SmartDukaan

Rev

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

Rev 24402 Rev 26218
Line 14... Line 14...
14
import javax.persistence.Transient;
14
import javax.persistence.Transient;
15
 
15
 
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
17
 
17
 
18
@Entity
18
@Entity
19
@Table(name="fofo.prebooking_listing", schema = "fofo")
19
@Table(name = "fofo.prebooking_listing", schema = "fofo")
20
public class PrebookingListing implements Serializable{
20
public class PrebookingListing implements Serializable {
21
 
21
 
22
	private static final long serialVersionUID = 1L;
22
	private static final long serialVersionUID = 1L;
23
 
23
 
24
	@Id
24
	@Id
25
	@Column(name = "id")
25
	@Column(name = "id")
26
	@GeneratedValue(strategy = GenerationType.IDENTITY)
26
	@GeneratedValue(strategy = GenerationType.IDENTITY)
27
	private int id;
27
	private int id;
28
 
28
 
29
	@Column(name = "catalog_id")
29
	@Column(name = "catalog_id")
30
	private int catalogId;
30
	private int catalogId;
31
	
31
 
32
	@Column(name = "advance_amount")
32
	@Column(name = "advance_amount")
33
	private float advanceAmount;
33
	private float advanceAmount;
34
	
34
 
35
	@Column(name = "tentative_amount")
35
	@Column(name = "tentative_amount")
36
	private float tentativeAmount;
36
	private float tentativeAmount;
37
	
37
 
38
	@Column(name = "created_by")
38
	@Column(name = "created_by")
39
	private int createdBy;
39
	private int createdBy;
-
 
40
 
-
 
41
	@Column(name = "placement_policy")
-
 
42
	private String placementPolicy;
40
	
43
 
-
 
44
	@Column(name = "activation_policy")
-
 
45
	private String activationPolicy;
-
 
46
 
41
	@Convert(converter = LocalDateTimeAttributeConverter.class)
47
	@Convert(converter = LocalDateTimeAttributeConverter.class)
42
	@Column(name = "active_timestamp")
48
	@Column(name = "active_timestamp")
43
	private LocalDateTime activeTimestamp = null;
49
	private LocalDateTime activeTimestamp = null;
44
	
50
 
45
	@Convert(converter = LocalDateTimeAttributeConverter.class)
51
	@Convert(converter = LocalDateTimeAttributeConverter.class)
46
	@Column(name = "expire_timestamp")
52
	@Column(name = "expire_timestamp")
47
	private LocalDateTime expireTimestamp = null;
53
	private LocalDateTime expireTimestamp = null;
48
	
54
 
49
	@Convert(converter = LocalDateTimeAttributeConverter.class)
55
	@Convert(converter = LocalDateTimeAttributeConverter.class)
50
	@Column(name = "create_timestamp")
56
	@Column(name = "create_timestamp")
51
	private LocalDateTime createTimestamp = LocalDateTime.now();
57
	private LocalDateTime createTimestamp = LocalDateTime.now();
52
	
58
 
53
	@Transient
59
	@Transient
54
	private String description;
60
	private String description;
55
 
61
 
-
 
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
 
56
	public int getId() {
82
	public int getId() {
57
		return id;
83
		return id;
58
	}
84
	}
59
 
85
 
60
	public void setId(int id) {
86
	public void setId(int id) {
61
		this.id = id;
87
		this.id = id;
62
	}
88
	}
63
	
-
 
64
	
-
 
65
 
89
 
66
	public int getCatalogId() {
90
	public int getCatalogId() {
67
		return catalogId;
91
		return catalogId;
68
	}
92
	}
69
 
93
 
Line 84... Line 108...
84
	}
108
	}
85
 
109
 
86
	public void setTentativeAmount(float tentativeAmount) {
110
	public void setTentativeAmount(float tentativeAmount) {
87
		this.tentativeAmount = tentativeAmount;
111
		this.tentativeAmount = tentativeAmount;
88
	}
112
	}
89
	
113
 
90
	public int getCreatedBy() {
114
	public int getCreatedBy() {
91
		return createdBy;
115
		return createdBy;
92
	}
116
	}
93
	
117
 
94
	public void setCreatedBy(int createdBy) {
118
	public void setCreatedBy(int createdBy) {
95
		this.createdBy = createdBy;
119
		this.createdBy = createdBy;
96
	}
120
	}
97
 
121
 
98
	public LocalDateTime getActiveTimestamp() {
122
	public LocalDateTime getActiveTimestamp() {
Line 100... Line 124...
100
	}
124
	}
101
 
125
 
102
	public void setActiveTimestamp(LocalDateTime activeTimestamp) {
126
	public void setActiveTimestamp(LocalDateTime activeTimestamp) {
103
		this.activeTimestamp = activeTimestamp;
127
		this.activeTimestamp = activeTimestamp;
104
	}
128
	}
105
	
129
 
106
	public LocalDateTime getExpireTimestamp() {
130
	public LocalDateTime getExpireTimestamp() {
107
		return expireTimestamp;
131
		return expireTimestamp;
108
	}
132
	}
109
	
133
 
110
	public void setExpireTimestamp(LocalDateTime expireTimestamp) {
134
	public void setExpireTimestamp(LocalDateTime expireTimestamp) {
111
		this.expireTimestamp = expireTimestamp;
135
		this.expireTimestamp = expireTimestamp;
112
	}
136
	}
113
 
137
 
114
	public LocalDateTime getCreateTimestamp() {
138
	public LocalDateTime getCreateTimestamp() {
Line 116... Line 140...
116
	}
140
	}
117
 
141
 
118
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
142
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
119
		this.createTimestamp = createTimestamp;
143
		this.createTimestamp = createTimestamp;
120
	}
144
	}
121
	
145
 
122
	public String getDescription() {
146
	public String getDescription() {
123
		return description;
147
		return description;
124
	}
148
	}
125
	
149
 
126
	public void setDescription(String description) {
150
	public void setDescription(String description) {
127
		this.description = description;
151
		this.description = description;
128
	}
152
	}
129
	
153
 
130
	public String getFormattedActiveTimestamp(){
154
	public String getFormattedActiveTimestamp() {
131
		if(activeTimestamp == null){
155
		if (activeTimestamp == null) {
132
			return null;
156
			return null;
133
		}
157
		}
134
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
158
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
135
		return activeTimestamp.format(formatter);
159
		return activeTimestamp.format(formatter);
136
    }
160
	}
137
	
161
 
138
	public String getFormattedExpireTimestamp(){
162
	public String getFormattedExpireTimestamp() {
139
		if(expireTimestamp == null){
163
		if (expireTimestamp == null) {
140
			return null;
164
			return null;
141
		}
165
		}
142
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
166
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
143
		return expireTimestamp.format(formatter);
167
		return expireTimestamp.format(formatter);
144
    }
168
	}
145
	
169
 
146
	public String getFormattedCreateTimestamp(){
170
	public String getFormattedCreateTimestamp() {
147
		if(createTimestamp == null){
171
		if (createTimestamp == null) {
148
			return null;
172
			return null;
149
		}
173
		}
150
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
174
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
151
		return createTimestamp.format(formatter);
175
		return createTimestamp.format(formatter);
152
    }
176
	}
153
 
177
 
154
	@Override
178
	@Override
155
	public int hashCode() {
179
	public int hashCode() {
156
		final int prime = 31;
180
		final int prime = 31;
157
		int result = 1;
181
		int result = 1;
Line 178... Line 202...
178
		return "PrebookingListing [id=" + id + ", catalogId=" + catalogId + ", advanceAmount=" + advanceAmount
202
		return "PrebookingListing [id=" + id + ", catalogId=" + catalogId + ", advanceAmount=" + advanceAmount
179
				+ ", tentativeAmount=" + tentativeAmount + ", createdBy=" + createdBy + ", activeTimestamp="
203
				+ ", tentativeAmount=" + tentativeAmount + ", createdBy=" + createdBy + ", activeTimestamp="
180
				+ activeTimestamp + ", expireTimestamp=" + expireTimestamp + ", createTimestamp=" + createTimestamp
204
				+ activeTimestamp + ", expireTimestamp=" + expireTimestamp + ", createTimestamp=" + createTimestamp
181
				+ ", description=" + description + "]";
205
				+ ", description=" + description + "]";
182
	}
206
	}
183
	
207
 
184
}
208
}