package com.publiccms.entities.cms;
// Generated 2020-3-26 11:25:55 by Hibernate Tools 6.0.0-SNAPSHOT

import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;

import com.publiccms.common.generator.annotation.GeneratorColumn;

/**
 * CmsVoteUserId generated by hbm2java
 */
@Embeddable
public class CmsUserVoteId implements java.io.Serializable {

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

    /**
     * user id<p>
     * 用户id
     */
    @GeneratorColumn(title = "用户", condition = true)
    private long userId;
    /**
     * vote id<p>
     * 投票id
     */
    @GeneratorColumn(title = "投票", condition = true)
    private long voteId;

    public CmsUserVoteId() {
    }

    public CmsUserVoteId(long userId, long voteId) {
        this.userId = userId;
        this.voteId = voteId;
    }

    @Column(name = "user_id", nullable = false)
    public long getUserId() {
        return this.userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Column(name = "vote_id", nullable = false)
    public long getVoteId() {
        return this.voteId;
    }

    public void setVoteId(long voteId) {
        this.voteId = voteId;
    }

    public boolean equals(Object other) {
        if ((this == other))
            return true;
        if ((other == null))
            return false;
        if (!(other instanceof CmsUserVoteId))
            return false;
        CmsUserVoteId castOther = (CmsUserVoteId) other;

        return (this.getUserId() == castOther.getUserId()) && (this.getVoteId() == castOther.getVoteId());
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result + (int) this.getUserId();
        result = 37 * result + (int) this.getVoteId();
        return result;
    }

}
