package com.publiccms.entities.cms;
// Generated 2016-11-19 14:08:55 by Hibernate Tools 4.3.1

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

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

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

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    /**
     * category id<p>
     * 分类id
     */
    @GeneratorColumn(title = "分类", condition = true)
    private int categoryId;
    /**
     * model id<p>
     * 模型id
     */
    @GeneratorColumn(title = "模型", condition = true)
    private String modelId;

    public CmsCategoryModelId() {
    }

    public CmsCategoryModelId(int categoryId, String modelId) {
        this.categoryId = categoryId;
        this.modelId = modelId;
    }

    @Column(name = "category_id", nullable = false)
    public int getCategoryId() {
        return this.categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    @Column(name = "model_id", nullable = false, length = 20)
    public String getModelId() {
        return this.modelId;
    }

    public void setModelId(String modelId) {
        this.modelId = modelId;
    }

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

        return (this.getCategoryId() == castOther.getCategoryId())
                && ((this.getModelId() == castOther.getModelId()) || (this.getModelId() != null && castOther.getModelId() != null
                        && this.getModelId().equals(castOther.getModelId())));
    }

    public int hashCode() {
        int result = 17;

        result = 37 * result + this.getCategoryId();
        result = 37 * result + (getModelId() == null ? 0 : this.getModelId().hashCode());
        return result;
    }

}
