Subversion Repositories SmartDukaan

Rev

Rev 27878 | Rev 31860 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.catalog;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.spice.profitmandi.dao.enumuration.catalog.AmountType;

@Entity
@Table(name = "catalog.target_slab", schema = "catalog")
public class TargetSlab implements Serializable {
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "offer_id")
    private int offerId;

    @Column(name="onwards_target")
    private int onwardsTarget;

    @Column(name="item_criteria_id")
    private int itemCriteriaId;
    
    @Column(name="amount_type")
    @Enumerated(EnumType.STRING)
    private AmountType amountType;

    @Column(name="payout_target")
    private int payoutTarget;
    
    @Column(name="target_description")
    private String targetDescription;

    @Column(name="payout_value")
    private float payoutValue;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getOfferId() {
        return offerId;
    }

    public void setOfferId(int offerId) {
        this.offerId = offerId;
    }

    public int getOnwardsTarget() {
        return onwardsTarget;
    }
    
    public String getTargetDescription() {
                return targetDescription;
        }

        public void setTargetDescription(String targetDescription) {
                this.targetDescription = targetDescription;
        }

        public AmountType getAmountType() {
                return amountType;
        }

        public void setAmountType(AmountType amountType) {
                this.amountType = amountType;
        }

        public void setOnwardsTarget(int onwardsTarget) {
        this.onwardsTarget = onwardsTarget;
    }

    public int getItemCriteriaId() {
        return itemCriteriaId;
    }

    public void setItemCriteriaId(int itemCriteriaId) {
        this.itemCriteriaId = itemCriteriaId;
    }

    public int getPayoutTarget() {
        return payoutTarget;
    }

    public void setPayoutTarget(int payoutTarget) {
        this.payoutTarget = payoutTarget;
    }

    public float getPayoutValue() {
        return payoutValue;
    }

    public void setPayoutValue(float payoutValue) {
        this.payoutValue = payoutValue;
    }

    @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                TargetSlab other = (TargetSlab) obj;
                if (amountType != other.amountType)
                        return false;
                if (id != other.id)
                        return false;
                if (itemCriteriaId != other.itemCriteriaId)
                        return false;
                if (offerId != other.offerId)
                        return false;
                if (onwardsTarget != other.onwardsTarget)
                        return false;
                if (payoutTarget != other.payoutTarget)
                        return false;
                if (Float.floatToIntBits(payoutValue) != Float.floatToIntBits(other.payoutValue))
                        return false;
                if (targetDescription == null) {
                        if (other.targetDescription != null)
                                return false;
                } else if (!targetDescription.equals(other.targetDescription))
                        return false;
                return true;
        }

    @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + ((amountType == null) ? 0 : amountType.hashCode());
                result = prime * result + id;
                result = prime * result + itemCriteriaId;
                result = prime * result + offerId;
                result = prime * result + onwardsTarget;
                result = prime * result + payoutTarget;
                result = prime * result + Float.floatToIntBits(payoutValue);
                result = prime * result + ((targetDescription == null) ? 0 : targetDescription.hashCode());
                return result;
        }

    @Override
        public String toString() {
                return "TargetSlab [id=" + id + ", offerId=" + offerId + ", onwardsTarget=" + onwardsTarget
                                + ", itemCriteriaId=" + itemCriteriaId + ", amountType=" + amountType + ", payoutTarget=" + payoutTarget
                                + ", targetDescription=" + targetDescription + ", payoutValue=" + payoutValue + "]";
        }
}