Subversion Repositories SmartDukaan

Rev

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

Rev 22925 Rev 23365
Line 2... Line 2...
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
4
 
4
 
5
import javax.persistence.Column;
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
6
import javax.persistence.Entity;
7
import javax.persistence.EnumType;
-
 
8
import javax.persistence.Enumerated;
-
 
9
import javax.persistence.GeneratedValue;
7
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
8
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
9
import javax.persistence.Id;
12
import javax.persistence.NamedQueries;
-
 
13
import javax.persistence.NamedQuery;
-
 
14
import javax.persistence.Table;
10
import javax.persistence.Table;
15
import javax.persistence.UniqueConstraint;
-
 
16
 
-
 
17
import com.spice.profitmandi.dao.enumuration.fofo.PaymentOptionType;
-
 
18
 
11
 
19
/**
12
/**
20
 * This class basically contains api details
13
 * This class basically contains payment option details
21
 * 
14
 * 
22
 * @author ashikali
15
 * @author ashikali
23
 *
16
 *
24
 */
17
 */
25
@Entity
18
@Entity
26
@Table(name="fofo.payment_option", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"order_id","type"})})
19
@Table(name="fofo.payment_option", schema = "fofo")
27
@NamedQueries({
-
 
28
	@NamedQuery(name = "PaymentOption.selectByOrderId", query = "select po from PaymentOption po where po.orderId = :orderId")
-
 
29
})
-
 
30
public class PaymentOption implements Serializable{
20
public class PaymentOption implements Serializable{
31
	
21
	
32
	private static final long serialVersionUID = 1L;
22
	private static final long serialVersionUID = 1L;
33
	
23
	
34
	public PaymentOption() {
24
	public PaymentOption() {
Line 37... Line 27...
37
	@Id
27
	@Id
38
	@Column(name="id")
28
	@Column(name="id")
39
	@GeneratedValue(strategy = GenerationType.IDENTITY)
29
	@GeneratedValue(strategy = GenerationType.IDENTITY)
40
	private int id;
30
	private int id;
41
	
31
	
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")
32
	@Column(name = "name", unique = true)
50
	private float amount;
33
	private String name;
51
	
34
	
52
	public int getId() {
35
	public int getId() {
53
		return id;
36
		return id;
54
	}
37
	}
55
	public void setId(int id) {
38
	public void setId(int id) {
56
		this.id = id;
39
		this.id = id;
57
	}
40
	}
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
	}
-
 
76
	
41
	
-
 
42
	public String getName() {
-
 
43
		return name;
-
 
44
	}
77
	
45
	
-
 
46
	public void setName(String name) {
-
 
47
		this.name = name;
-
 
48
	}
78
	
49
	
79
	@Override
50
	@Override
80
	public int hashCode() {
51
	public int hashCode() {
81
		final int prime = 31;
52
		final int prime = 31;
82
		int result = 1;
53
		int result = 1;
Line 94... Line 65...
94
		PaymentOption other = (PaymentOption) obj;
65
		PaymentOption other = (PaymentOption) obj;
95
		if (id != other.id)
66
		if (id != other.id)
96
			return false;
67
			return false;
97
		return true;
68
		return true;
98
	}
69
	}
-
 
70
	
99
	@Override
71
	@Override
100
	public String toString() {
72
	public String toString() {
101
		return "PaymentOption [id=" + id + ", orderId=" + orderId + ", type=" + type + ", amount=" + amount + "]";
73
		return "PaymentOption [id=" + id + ", name=" + name + "]";
102
	}
74
	}
103
	
75
	
104
	
76
	
105
	
-
 
106
}
77
}
107
78