Subversion Repositories SmartDukaan

Rev

Rev 21714 | Rev 21984 | 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;
5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
8
import javax.persistence.GeneratedValue;
9
import javax.persistence.GenerationType;
10
import javax.persistence.Id;
11
import javax.persistence.NamedQueries;
12
import javax.persistence.NamedQuery;
13
import javax.persistence.Table;
14
 
15
@Entity
16
@Table(name="fofo.fofo_order", schema = "fofo")
17
@NamedQueries({
18
	@NamedQuery(name = "FofoOrder.selectCount", query = "select count(fo) from FofoOrder fo"),
19
	@NamedQuery(name = "FofoOrder.selectById", query = "select fo from FofoOrder fo where fo.id = :id"),
20
	@NamedQuery(name = "FofoOrder.selectByFofoId", query = "select fo from FofoOrder fo where fo.fofoId = :fofoId"),
21
	@NamedQuery(name = "FofoOrder.selectTotolAmountByFofoId", query = "select sum(fo.totalAmount) from FofoOrder fo where fo.fofoId = :fofoId group by fo.fofoId"),
22
	@NamedQuery(name = "FofoOrder.selectByInvoiceNumber", query = "select fo from FofoOrder fo where fo.invoiceNumber = :invoiceNumber")
23
})
24
public class FofoOrder implements Serializable{
25
 
26
	private static final long serialVersionUID = 1L;
27
 
28
	@Id
29
	@Column(name = "id")
30
	@GeneratedValue(strategy = GenerationType.IDENTITY)
31
	private int id;
32
 
33
	@Column(name = "fofo_id")
34
	private int fofoId;
35
 
36
	@Column(name = "customer_id")
37
	private int customerId;
38
 
21710 ashik.ali 39
	@Column(name = "customer_address_id")
40
	private int customerAddressId;
41
 
21596 ashik.ali 42
	@Column(name = "total_amount")
43
	private float totalAmount;
44
 
21609 ashik.ali 45
	@Column(name = "invoice_number", length = 50)
21596 ashik.ali 46
	private String invoiceNumber;
47
 
48
	@Column(name = "create_timestamp")
49
	private LocalDateTime createTimestamp = LocalDateTime.now();
50
 
51
	public int getId() {
52
		return id;
53
	}
54
	public void setId(int id) {
55
		this.id = id;
56
	}
57
	public int getFofoId() {
58
		return fofoId;
59
	}
60
	public void setFofoId(int fofoId) {
61
		this.fofoId = fofoId;
62
	}
63
	public int getCustomerId() {
64
		return customerId;
65
	}
66
	public void setCustomerId(int customerId) {
67
		this.customerId = customerId;
68
	}
21710 ashik.ali 69
	public int getCustomerAddressId() {
70
		return customerAddressId;
71
	}
72
	public void setCustomerAddressId(int customerAddressId) {
73
		this.customerAddressId = customerAddressId;
74
	}
21596 ashik.ali 75
	public float getTotalAmount() {
76
		return totalAmount;
77
	}
78
	public void setTotalAmount(float totalAmount) {
79
		this.totalAmount = totalAmount;
80
	}
81
	public String getInvoiceNumber() {
82
		return invoiceNumber;
83
	}
84
	public void setInvoiceNumber(String invoiceNumber) {
85
		this.invoiceNumber = invoiceNumber;
86
	}
87
	public LocalDateTime getCreateTimestamp() {
88
		return createTimestamp;
89
	}
90
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
91
		this.createTimestamp = createTimestamp;
92
	}
21924 ashik.ali 93
 
94
 
21602 ashik.ali 95
	@Override
21924 ashik.ali 96
	public int hashCode() {
97
		final int prime = 31;
98
		int result = 1;
99
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
100
		result = prime * result + customerAddressId;
101
		result = prime * result + customerId;
102
		result = prime * result + fofoId;
103
		result = prime * result + id;
104
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
105
		result = prime * result + Float.floatToIntBits(totalAmount);
106
		return result;
107
	}
108
	@Override
109
	public boolean equals(Object obj) {
110
		if (this == obj)
111
			return true;
112
		if (obj == null)
113
			return false;
114
		if (getClass() != obj.getClass())
115
			return false;
116
		FofoOrder other = (FofoOrder) obj;
117
		if (createTimestamp == null) {
118
			if (other.createTimestamp != null)
119
				return false;
120
		} else if (!createTimestamp.equals(other.createTimestamp))
121
			return false;
122
		if (customerAddressId != other.customerAddressId)
123
			return false;
124
		if (customerId != other.customerId)
125
			return false;
126
		if (fofoId != other.fofoId)
127
			return false;
128
		if (id != other.id)
129
			return false;
130
		if (invoiceNumber == null) {
131
			if (other.invoiceNumber != null)
132
				return false;
133
		} else if (!invoiceNumber.equals(other.invoiceNumber))
134
			return false;
135
		if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount))
136
			return false;
137
		return true;
138
	}
139
	@Override
21602 ashik.ali 140
	public String toString() {
21710 ashik.ali 141
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
142
				+ customerAddressId + ", totalAmount=" + totalAmount + ", invoiceNumber=" + invoiceNumber
143
				+ ", createTimestamp=" + createTimestamp + "]";
21602 ashik.ali 144
	}
145
 
21710 ashik.ali 146
 
21596 ashik.ali 147
}