Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
@Table(name = "fofo.sale_reward_history")
public class SaleRewardHistory {

    @Id
    @Column
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "fofo_id", nullable = false)
    private Integer fofoId;

    @Column(name = "order_id", nullable = false)
    private Integer orderId;

    @Column(name = "catalog_id", nullable = false)
    private Integer catalogId;

    @Column(name = "qty", nullable = false)
    private Integer qty;

    @Column(name = "point_earned", nullable = false, precision = 6, scale = 2)
    private BigDecimal pointEarned;

    @Column(name = "imeis", nullable = false, length = 50)
    private String imeis;

    @Column(name = "created_at", nullable = false, updatable = false)
    private LocalDateTime createdAt = LocalDateTime.now();


    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public Integer getFofoId() { return fofoId; }
    public void setFofoId(Integer fofoId) { this.fofoId = fofoId; }

    public Integer getOrderId() { return orderId; }
    public void setOrderId(Integer orderId) { this.orderId = orderId; }

    public Integer getCatalogId() { return catalogId; }
    public void setCatalogId(Integer catalogId) { this.catalogId = catalogId; }

    public Integer getQty() { return qty; }
    public void setQty(Integer qty) { this.qty = qty; }

    public BigDecimal getPointEarned() { return pointEarned; }
    public void setPointEarned(BigDecimal pointEarned) { this.pointEarned = pointEarned; }

    public String getImeis() { return imeis; }
    public void setImeis(String imeis) { this.imeis = imeis; }

    public LocalDateTime getCreatedAt() { return createdAt; }
    public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof SaleRewardHistory)) return false;
        SaleRewardHistory that = (SaleRewardHistory) o;
        return Objects.equals(id, that.id) && Objects.equals(fofoId, that.fofoId) && Objects.equals(orderId, that.orderId) && Objects.equals(catalogId, that.catalogId) && Objects.equals(qty, that.qty) && Objects.equals(pointEarned, that.pointEarned) && Objects.equals(imeis, that.imeis) && Objects.equals(createdAt, that.createdAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, fofoId, orderId, catalogId, qty, pointEarned, imeis, createdAt);
    }
}