Subversion Repositories SmartDukaan

Rev

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 java.time.LocalDateTime;

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

@Entity
@Table(name = "catalog.high_demand_items", schema = "catalog")
public class HighDemandItem implements Serializable {

        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        @Id
        @Column(name = "id", columnDefinition = "int(11)")
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;

        @Column(name = "catalog_id")
        private int catalogId;

        @Column(name = "qty")
        private int qty;

        @Column(name = "create_timestamp")
        private LocalDateTime createTimestamp;

        @Column(name = "update_timestamp")
        private LocalDateTime updateTimestamp;

        public int getId() {
                return id;
        }

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

        public int getCatalogId() {
                return catalogId;
        }

        public void setCatalogId(int catalogId) {
                this.catalogId = catalogId;
        }

        public int getQty() {
                return qty;
        }

        public void setQty(int qty) {
                this.qty = qty;
        }

        public LocalDateTime getCreateTimestamp() {
                return createTimestamp;
        }

        public void setCreateTimestamp(LocalDateTime createTimestamp) {
                this.createTimestamp = createTimestamp;
        }

        public LocalDateTime getUpdateTimestamp() {
                return updateTimestamp;
        }

        public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
                this.updateTimestamp = updateTimestamp;
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + catalogId;
                result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
                result = prime * result + id;
                result = prime * result + qty;
                result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
                return result;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                HighDemandItem other = (HighDemandItem) obj;
                if (catalogId != other.catalogId)
                        return false;
                if (createTimestamp == null) {
                        if (other.createTimestamp != null)
                                return false;
                } else if (!createTimestamp.equals(other.createTimestamp))
                        return false;
                if (id != other.id)
                        return false;
                if (qty != other.qty)
                        return false;
                if (updateTimestamp == null) {
                        if (other.updateTimestamp != null)
                                return false;
                } else if (!updateTimestamp.equals(other.updateTimestamp))
                        return false;
                return true;
        }

        @Override
        public String toString() {
                return "HighDemandItems [id=" + id + ", catalogId=" + catalogId + ", qty=" + qty + ", createTimestamp="
                                + createTimestamp + ", updateTimestamp=" + updateTimestamp + "]";
        }

}