UserCoupon.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package com.futu.course.orders.domain;
  2. import com.baomidou.mybatisplus.annotation.IdType;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import java.io.Serializable;
  7. import lombok.Data;
  8. /**
  9. *
  10. * @TableName user_coupon
  11. */
  12. @TableName(value ="user_coupon")
  13. @Data
  14. public class UserCoupon implements Serializable {
  15. /**
  16. *
  17. */
  18. @TableId
  19. private Long userId;
  20. /**
  21. *
  22. */
  23. private Long couponId;
  24. @TableField(exist = false)
  25. private static final long serialVersionUID = 1L;
  26. @Override
  27. public boolean equals(Object that) {
  28. if (this == that) {
  29. return true;
  30. }
  31. if (that == null) {
  32. return false;
  33. }
  34. if (getClass() != that.getClass()) {
  35. return false;
  36. }
  37. UserCoupon other = (UserCoupon) that;
  38. return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
  39. && (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()));
  40. }
  41. @Override
  42. public int hashCode() {
  43. final int prime = 31;
  44. int result = 1;
  45. result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  46. result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
  47. return result;
  48. }
  49. @Override
  50. public String toString() {
  51. StringBuilder sb = new StringBuilder();
  52. sb.append(getClass().getSimpleName());
  53. sb.append(" [");
  54. sb.append("Hash = ").append(hashCode());
  55. sb.append(", userId=").append(userId);
  56. sb.append(", couponId=").append(couponId);
  57. sb.append(", serialVersionUID=").append(serialVersionUID);
  58. sb.append("]");
  59. return sb.toString();
  60. }
  61. }