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