Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
27878 amit.gupta 1
package com.spice.profitmandi.dao.entity.catalog;
2
 
27918 amit.gupta 3
import java.io.Serializable;
27878 amit.gupta 4
 
27918 amit.gupta 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.Table;
13
 
27878 amit.gupta 14
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
15
 
16
@Entity
17
@Table(name = "catalog.target_slab", schema = "catalog")
18
public class TargetSlab implements Serializable {
19
    @Id
20
    @Column(name = "id")
21
    @GeneratedValue(strategy = GenerationType.IDENTITY)
22
    private int id;
23
 
24
    @Column(name = "offer_id")
25
    private int offerId;
26
 
27
    @Column(name="onwards_target")
28
    private int onwardsTarget;
29
 
30
    @Column(name="item_criteria_id")
31
    private int itemCriteriaId;
32
 
33
    @Column(name="amount_type")
34
    @Enumerated(EnumType.STRING)
35
    private AmountType amountType;
36
 
37
    @Column(name="payout_target")
38
    private int payoutTarget;
39
 
40
    @Column(name="target_description")
41
    private String targetDescription;
42
 
43
    @Column(name="payout_value")
44
    private float payoutValue;
45
 
46
 
47
    public int getId() {
48
        return id;
49
    }
50
 
51
    public void setId(int id) {
52
        this.id = id;
53
    }
54
 
55
    public int getOfferId() {
56
        return offerId;
57
    }
58
 
59
    public void setOfferId(int offerId) {
60
        this.offerId = offerId;
61
    }
62
 
63
    public int getOnwardsTarget() {
64
        return onwardsTarget;
65
    }
66
 
67
    public String getTargetDescription() {
68
		return targetDescription;
69
	}
70
 
71
	public void setTargetDescription(String targetDescription) {
72
		this.targetDescription = targetDescription;
73
	}
74
 
75
	public AmountType getAmountType() {
76
		return amountType;
77
	}
78
 
79
	public void setAmountType(AmountType amountType) {
80
		this.amountType = amountType;
81
	}
82
 
83
	public void setOnwardsTarget(int onwardsTarget) {
84
        this.onwardsTarget = onwardsTarget;
85
    }
86
 
87
    public int getItemCriteriaId() {
88
        return itemCriteriaId;
89
    }
90
 
91
    public void setItemCriteriaId(int itemCriteriaId) {
92
        this.itemCriteriaId = itemCriteriaId;
93
    }
94
 
95
    public int getPayoutTarget() {
96
        return payoutTarget;
97
    }
98
 
99
    public void setPayoutTarget(int payoutTarget) {
100
        this.payoutTarget = payoutTarget;
101
    }
102
 
103
    public float getPayoutValue() {
104
        return payoutValue;
105
    }
106
 
107
    public void setPayoutValue(float payoutValue) {
108
        this.payoutValue = payoutValue;
109
    }
110
 
111
    @Override
112
	public boolean equals(Object obj) {
113
		if (this == obj)
114
			return true;
115
		if (obj == null)
116
			return false;
117
		if (getClass() != obj.getClass())
118
			return false;
119
		TargetSlab other = (TargetSlab) obj;
120
		if (amountType != other.amountType)
121
			return false;
122
		if (id != other.id)
123
			return false;
124
		if (itemCriteriaId != other.itemCriteriaId)
125
			return false;
126
		if (offerId != other.offerId)
127
			return false;
128
		if (onwardsTarget != other.onwardsTarget)
129
			return false;
130
		if (payoutTarget != other.payoutTarget)
131
			return false;
132
		if (Float.floatToIntBits(payoutValue) != Float.floatToIntBits(other.payoutValue))
133
			return false;
134
		if (targetDescription == null) {
135
			if (other.targetDescription != null)
136
				return false;
137
		} else if (!targetDescription.equals(other.targetDescription))
138
			return false;
139
		return true;
140
	}
141
 
142
    @Override
143
	public int hashCode() {
144
		final int prime = 31;
145
		int result = 1;
146
		result = prime * result + ((amountType == null) ? 0 : amountType.hashCode());
147
		result = prime * result + id;
148
		result = prime * result + itemCriteriaId;
149
		result = prime * result + offerId;
150
		result = prime * result + onwardsTarget;
151
		result = prime * result + payoutTarget;
152
		result = prime * result + Float.floatToIntBits(payoutValue);
153
		result = prime * result + ((targetDescription == null) ? 0 : targetDescription.hashCode());
154
		return result;
155
	}
156
 
157
    @Override
158
	public String toString() {
159
		return "TargetSlab [id=" + id + ", offerId=" + offerId + ", onwardsTarget=" + onwardsTarget
160
				+ ", itemCriteriaId=" + itemCriteriaId + ", amountType=" + amountType + ", payoutTarget=" + payoutTarget
161
				+ ", targetDescription=" + targetDescription + ", payoutValue=" + payoutValue + "]";
162
	}
163
}