package com.publiccms.entities.sys;
// Generated 2025-03-17 09:18:59 by Hibernate Tools 5.6.15.Final

import org.hibernate.validator.constraints.Length;

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

import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import jakarta.validation.constraints.NotNull;

/**
 * SysConfigDataId generated by hbm2java
 */
@Embeddable
public class SysUserSettingId implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @GeneratorColumn(title = "用户", condition = true)
    private long userId;
    /**
     * code
     * <p>
     * 编码
     */
    @GeneratorColumn(title = "编码", condition = true)
    @NotNull
    @Length(max = 50)
    private String code;

    public SysUserSettingId() {
    }

    public SysUserSettingId(long userId, String code) {
        this.userId = userId;
        this.code = code;
    }

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

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

    @Column(name = "code", nullable = false, length = 50)
    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

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

        return (this.getUserId() == castOther.getUserId()) && ((this.getCode() == castOther.getCode())
                || (this.getCode() != null && castOther.getCode() != null && this.getCode().equals(castOther.getCode())));
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result + (int) this.getUserId();
        result = 37 * result + (getCode() == null ? 0 : this.getCode().hashCode());
        return result;
    }

}
