Subversion Repositories SmartDukaan

Rev

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.fofo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

@Entity
@Table(name = "fofo.scheme_item")
public class SchemeItem implements Serializable {

        private static final long serialVersionUID = 1L;

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

        @Id
        @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();

        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;
        }

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

        @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) && Objects.equals(createTimestamp, that.createTimestamp);
        }

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

        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;
        }
}