Subversion Repositories SmartDukaan

Rev

Rev 31903 | Details | Compare with Previous | Last modification | View Log | RSS feed

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