Subversion Repositories SmartDukaan

Rev

Rev 22009 | Rev 23365 | 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
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.EnumType;
8
import javax.persistence.Enumerated;
9
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
12
import javax.persistence.NamedQueries;
13
import javax.persistence.NamedQuery;
14
import javax.persistence.Table;
15
import javax.persistence.UniqueConstraint;
16
 
21714 ashik.ali 17
import com.spice.profitmandi.dao.enumuration.fofo.PaymentOptionType;
21596 ashik.ali 18
 
19
/**
20
 * This class basically contains api details
21
 * 
22
 * @author ashikali
23
 *
24
 */
25
@Entity
26
@Table(name="fofo.payment_option", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"order_id","type"})})
27
@NamedQueries({
22925 ashik.ali 28
	@NamedQuery(name = "PaymentOption.selectByOrderId", query = "select po from PaymentOption po where po.orderId = :orderId")
21596 ashik.ali 29
})
30
public class PaymentOption implements Serializable{
31
 
32
	private static final long serialVersionUID = 1L;
33
 
34
	public PaymentOption() {
35
	}
36
 
37
	@Id
38
	@Column(name="id")
39
	@GeneratedValue(strategy = GenerationType.IDENTITY)
40
	private int id;
41
 
42
	@Column(name = "order_id")
43
	private int orderId;
44
 
45
	@Enumerated(EnumType.STRING)
46
	@Column(name = "type")
47
	private PaymentOptionType type;
48
 
49
	@Column(name = "amount")
50
	private float amount;
51
 
52
	public int getId() {
53
		return id;
54
	}
55
	public void setId(int id) {
56
		this.id = id;
57
	}
58
	public int getOrderId() {
59
		return orderId;
60
	}
61
	public void setOrderId(int orderId) {
62
		this.orderId = orderId;
63
	}
64
	public PaymentOptionType getType() {
65
		return type;
66
	}
67
	public void setType(PaymentOptionType type) {
68
		this.type = type;
69
	}
70
	public float getAmount() {
71
		return amount;
72
	}
73
	public void setAmount(float amount) {
74
		this.amount = amount;
75
	}
21924 ashik.ali 76
 
77
 
22009 ashik.ali 78
 
21602 ashik.ali 79
	@Override
21924 ashik.ali 80
	public int hashCode() {
81
		final int prime = 31;
82
		int result = 1;
83
		result = prime * result + id;
84
		return result;
85
	}
86
	@Override
87
	public boolean equals(Object obj) {
88
		if (this == obj)
89
			return true;
90
		if (obj == null)
91
			return false;
92
		if (getClass() != obj.getClass())
93
			return false;
94
		PaymentOption other = (PaymentOption) obj;
95
		if (id != other.id)
96
			return false;
97
		return true;
98
	}
99
	@Override
21602 ashik.ali 100
	public String toString() {
101
		return "PaymentOption [id=" + id + ", orderId=" + orderId + ", type=" + type + ", amount=" + amount + "]";
102
	}
21596 ashik.ali 103
 
21602 ashik.ali 104
 
105
 
21596 ashik.ali 106
}