Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21714 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
21596 ashik.ali 2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
22243 ashik.ali 5
import java.time.format.DateTimeFormatter;
21596 ashik.ali 6
 
7
import javax.persistence.Column;
22009 ashik.ali 8
import javax.persistence.Convert;
21596 ashik.ali 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;
14
 
22009 ashik.ali 15
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
16
 
21596 ashik.ali 17
@Entity
18
@Table(name="fofo.fofo_order", schema = "fofo")
19
public class FofoOrder implements Serializable{
20
 
21
	private static final long serialVersionUID = 1L;
22
 
23
	@Id
24
	@Column(name = "id")
25
	@GeneratedValue(strategy = GenerationType.IDENTITY)
26
	private int id;
27
 
28
	@Column(name = "fofo_id")
29
	private int fofoId;
30
 
31
	@Column(name = "customer_id")
32
	private int customerId;
33
 
21710 ashik.ali 34
	@Column(name = "customer_address_id")
35
	private int customerAddressId;
36
 
21596 ashik.ali 37
	@Column(name = "total_amount")
38
	private float totalAmount;
39
 
21609 ashik.ali 40
	@Column(name = "invoice_number", length = 50)
21596 ashik.ali 41
	private String invoiceNumber;
42
 
22859 ashik.ali 43
	@Column(name = "cashback")
44
	private float cashback;
45
 
22009 ashik.ali 46
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21596 ashik.ali 47
	@Column(name = "create_timestamp")
23202 ashik.ali 48
	private LocalDateTime createTimestamp = LocalDateTime.now();	
21596 ashik.ali 49
 
21984 kshitij.so 50
	public int getId() {
51
		return id;
52
	}
53
	public void setId(int id) {
54
		this.id = id;
55
	}
56
	public int getFofoId() {
57
		return fofoId;
58
	}
59
	public void setFofoId(int fofoId) {
60
		this.fofoId = fofoId;
61
	}
62
	public int getCustomerId() {
63
		return customerId;
64
	}
65
	public void setCustomerId(int customerId) {
66
		this.customerId = customerId;
67
	}
68
	public int getCustomerAddressId() {
69
		return customerAddressId;
70
	}
71
	public void setCustomerAddressId(int customerAddressId) {
72
		this.customerAddressId = customerAddressId;
73
	}
74
	public float getTotalAmount() {
75
		return totalAmount;
76
	}
77
	public void setTotalAmount(float totalAmount) {
78
		this.totalAmount = totalAmount;
79
	}
80
	public String getInvoiceNumber() {
81
		return invoiceNumber;
82
	}
83
	public void setInvoiceNumber(String invoiceNumber) {
84
		this.invoiceNumber = invoiceNumber;
85
	}
22859 ashik.ali 86
	public float getCashback() {
87
		return cashback;
88
	}
89
	public void setCashback(float cashback) {
90
		this.cashback = cashback;
91
	}
21984 kshitij.so 92
	public LocalDateTime getCreateTimestamp() {
93
		return createTimestamp;
94
	}
95
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
96
		this.createTimestamp = createTimestamp;
97
	}
22009 ashik.ali 98
 
22243 ashik.ali 99
	public String getFormattedDate(){
100
    	DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
101
		return this.createTimestamp.format(formatter);
102
    }
22009 ashik.ali 103
 
21924 ashik.ali 104
	@Override
22009 ashik.ali 105
	public int hashCode() {
106
		final int prime = 31;
107
		int result = 1;
108
		result = prime * result + id;
109
		return result;
110
	}
22859 ashik.ali 111
 
22009 ashik.ali 112
	@Override
113
	public boolean equals(Object obj) {
114
		if (this == obj)
115
			return true;
116
		if (obj == null)
117
			return false;
118
		if (getClass() != obj.getClass())
119
			return false;
120
		FofoOrder other = (FofoOrder) obj;
121
		if (id != other.id)
122
			return false;
123
		return true;
124
	}
22859 ashik.ali 125
 
22009 ashik.ali 126
	@Override
21602 ashik.ali 127
	public String toString() {
21710 ashik.ali 128
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
129
				+ customerAddressId + ", totalAmount=" + totalAmount + ", invoiceNumber=" + invoiceNumber
23202 ashik.ali 130
				+ ", cashback=" + cashback + ", createTimestamp=" + createTimestamp + "]";
21602 ashik.ali 131
	}
132
 
21596 ashik.ali 133
}