Subversion Repositories SmartDukaan

Rev

Rev 34317 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

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

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

@Entity
@Table(name = "fofo.scheme_item",
                uniqueConstraints = @UniqueConstraint(columnNames = {"catalog_id", "scheme_id", "start_date", "end_date"}))
public class SchemeItem implements Serializable {

        private static final long serialVersionUID = 1L;

        @Id
        @Column(name = "id")
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private long id;

        @Column(name = "scheme_id")
        private int schemeId;

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

        @Column(name = "start_date")
        private LocalDateTime startDate;

        @Column(name = "end_date")
        private LocalDateTime endDate;

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

        @Column(name = "updated_by")
        private Integer updatedBy;

        @Column(name = "updated_on")
        private LocalDateTime updatedOn;

        public long getId() {
                return id;
        }

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

        public int getSchemeId() {
                return schemeId;
        }

        public void setSchemeId(int schemeId) {
                this.schemeId = schemeId;
        }

        public LocalDateTime getCreateTimestamp() {
                return createTimestamp;
        }

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

        public int getCatalogId() {
                return catalogId;
        }

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

        public Integer getUpdatedBy() {
                return updatedBy;
        }

        public void setUpdatedBy(Integer updatedBy) {
                this.updatedBy = updatedBy;
        }

        public LocalDateTime getUpdatedOn() {
                return updatedOn;
        }

        public void setUpdatedOn(LocalDateTime updatedOn) {
                this.updatedOn = updatedOn;
        }

        @Override
        public String toString() {
                return "SchemeItem{" +
                                "id=" + id +
                                ", schemeId=" + schemeId +
                                ", catalogId=" + catalogId +
                                ", startDate=" + startDate +
                                ", endDate=" + endDate +
                                ", createTimestamp=" + createTimestamp +
                                ", updatedBy=" + updatedBy +
                                ", updatedOn=" + updatedOn +
                                '}';
        }

        @Override
        public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                SchemeItem that = (SchemeItem) o;
                return schemeId == that.schemeId && catalogId == that.catalogId && Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate);
        }

        @Override
        public int hashCode() {
                return Objects.hash(schemeId, catalogId, startDate, endDate);
        }

        public LocalDateTime getStartDate() {
                return startDate;
        }

        public void setStartDate(LocalDateTime startDate) {
                this.startDate = startDate;
        }

        public LocalDateTime getEndDate() {
                return endDate;
        }

        public void setEndDate(LocalDateTime endDate) {
                this.endDate = endDate;
        }
}