Subversion Repositories SmartDukaan

Rev

Rev 23202 | Rev 24264 | 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
 
23369 ashik.ali 37
	@Column(name = "customer_gst_number")
38
	private String customerGstNumber;
39
 
21596 ashik.ali 40
	@Column(name = "total_amount")
41
	private float totalAmount;
42
 
21609 ashik.ali 43
	@Column(name = "invoice_number", length = 50)
21596 ashik.ali 44
	private String invoiceNumber;
45
 
22859 ashik.ali 46
	@Column(name = "cashback")
47
	private float cashback;
48
 
22009 ashik.ali 49
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21596 ashik.ali 50
	@Column(name = "create_timestamp")
23202 ashik.ali 51
	private LocalDateTime createTimestamp = LocalDateTime.now();	
21596 ashik.ali 52
 
21984 kshitij.so 53
	public int getId() {
54
		return id;
55
	}
56
	public void setId(int id) {
57
		this.id = id;
58
	}
59
	public int getFofoId() {
60
		return fofoId;
61
	}
62
	public void setFofoId(int fofoId) {
63
		this.fofoId = fofoId;
64
	}
65
	public int getCustomerId() {
66
		return customerId;
67
	}
68
	public void setCustomerId(int customerId) {
69
		this.customerId = customerId;
70
	}
71
	public int getCustomerAddressId() {
72
		return customerAddressId;
73
	}
74
	public void setCustomerAddressId(int customerAddressId) {
75
		this.customerAddressId = customerAddressId;
76
	}
23369 ashik.ali 77
	public String getCustomerGstNumber() {
78
		return customerGstNumber;
79
	}
80
	public void setCustomerGstNumber(String customerGstNumber) {
81
		this.customerGstNumber = customerGstNumber;
82
	}
21984 kshitij.so 83
	public float getTotalAmount() {
84
		return totalAmount;
85
	}
86
	public void setTotalAmount(float totalAmount) {
87
		this.totalAmount = totalAmount;
88
	}
89
	public String getInvoiceNumber() {
90
		return invoiceNumber;
91
	}
92
	public void setInvoiceNumber(String invoiceNumber) {
93
		this.invoiceNumber = invoiceNumber;
94
	}
22859 ashik.ali 95
	public float getCashback() {
96
		return cashback;
97
	}
98
	public void setCashback(float cashback) {
99
		this.cashback = cashback;
100
	}
21984 kshitij.so 101
	public LocalDateTime getCreateTimestamp() {
102
		return createTimestamp;
103
	}
104
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
105
		this.createTimestamp = createTimestamp;
106
	}
22009 ashik.ali 107
 
22243 ashik.ali 108
	public String getFormattedDate(){
109
    	DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
110
		return this.createTimestamp.format(formatter);
111
    }
22009 ashik.ali 112
 
21924 ashik.ali 113
	@Override
22009 ashik.ali 114
	public int hashCode() {
115
		final int prime = 31;
116
		int result = 1;
117
		result = prime * result + id;
118
		return result;
119
	}
22859 ashik.ali 120
 
22009 ashik.ali 121
	@Override
122
	public boolean equals(Object obj) {
123
		if (this == obj)
124
			return true;
125
		if (obj == null)
126
			return false;
127
		if (getClass() != obj.getClass())
128
			return false;
129
		FofoOrder other = (FofoOrder) obj;
130
		if (id != other.id)
131
			return false;
132
		return true;
133
	}
22859 ashik.ali 134
 
22009 ashik.ali 135
	@Override
21602 ashik.ali 136
	public String toString() {
21710 ashik.ali 137
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
23369 ashik.ali 138
				+ customerAddressId + ", customerGstNumber=" + customerGstNumber + ", totalAmount=" + totalAmount
139
				+ ", invoiceNumber=" + invoiceNumber + ", cashback=" + cashback + ", createTimestamp=" + createTimestamp
140
				+ "]";
21602 ashik.ali 141
	}
142
 
21596 ashik.ali 143
}