package com.publiccms.entities.trade;
// Generated 2023-8-7 21:42:23 by Hibernate Tools 5.6.15.Final

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

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

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

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    /**
     * user
     * <p>
     * 用户
     */
    @GeneratorColumn(title = "用户", condition = true)
    private long userId;
    /** 
     * coupon
     * <p>
     * 优惠券
     */
    @GeneratorColumn(title = "优惠券", condition = true)
    private long couponId;

    public TradeUserCouponId() {
    }

    public TradeUserCouponId(long userId, long couponId) {
        this.userId = userId;
        this.couponId = couponId;
    }

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

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

    @Column(name = "coupon_id", nullable = false)
    public long getCouponId() {
        return this.couponId;
    }

    public void setCouponId(long couponId) {
        this.couponId = couponId;
    }

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

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

    public int hashCode() {
        int result = 17;

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

}
