package com.apobates.forum.core.entity;

import java.io.Serializable;
import java.time.LocalDateTime;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 版块与轮播图关联
 *
 * @author xiaofanku
 * @since 20200614
 */
@Entity
@Table(name = "apo_topic_carousel_board_index", uniqueConstraints = {@UniqueConstraint(columnNames = {"volumesId", "boardId", "carouselId"})})
public class BoardCarouselIndex implements Serializable {
    private static final long serialVersionUID = -3704975653505624938L;
    @Id
    private int carouselId;
    //卷的ID
    @Id
    private int volumesId;
    //版块
    @Id
    private long boardId;
    //发布日期
    private LocalDateTime entryDateTime;
    //到期的日期
    private LocalDateTime expireDateTime;
    
    public int getCarouselId() {
        return carouselId;
    }
    
    public void setCarouselId(int carouselId) {
        this.carouselId = carouselId;
    }
    
    public int getVolumesId() {
        return volumesId;
    }
    
    public void setVolumesId(int volumesId) {
        this.volumesId = volumesId;
    }
    
    public long getBoardId() {
        return boardId;
    }
    
    public void setBoardId(long boardId) {
        this.boardId = boardId;
    }
    
    public LocalDateTime getEntryDateTime() {
        return entryDateTime;
    }
    
    public void setEntryDateTime(LocalDateTime entryDateTime) {
        this.entryDateTime = entryDateTime;
    }
    
    public LocalDateTime getExpireDateTime() {
        return expireDateTime;
    }
    
    public void setExpireDateTime(LocalDateTime expireDateTime) {
        this.expireDateTime = expireDateTime;
    }
    
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 17 * hash + this.carouselId;
        hash = 17 * hash + this.volumesId;
        hash = 17 * hash + (int) (this.boardId ^ (this.boardId >>> 32));
        return hash;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final BoardCarouselIndex other = (BoardCarouselIndex) obj;
        if (this.carouselId != other.carouselId) {
            return false;
        }
        if (this.volumesId != other.volumesId) {
            return false;
        }
        if (this.boardId != other.boardId) {
            return false;
        }
        return true;
    }
}