TemplateMusicInfo.java 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.zzys.lightting.template.dao.model;
  2. import com.zzys.lightting.base.model.BaseEntity;
  3. import lombok.*;
  4. import org.hibernate.Hibernate;
  5. import org.hibernate.annotations.DynamicUpdate;
  6. import javax.persistence.Column;
  7. import javax.persistence.Entity;
  8. import javax.persistence.Table;
  9. import java.util.Objects;
  10. /**
  11. * @Author: zzf
  12. * @Date: 2024/5/23:16:20
  13. * @Description:
  14. */
  15. @Entity
  16. @ToString
  17. @RequiredArgsConstructor
  18. @Getter
  19. @Setter
  20. @AllArgsConstructor
  21. @Table(name = "lt_template_music_info")
  22. @org.hibernate.annotations.Table(appliesTo = "lt_template_music_info", comment = "音乐模板表")
  23. @DynamicUpdate
  24. public class TemplateMusicInfo extends BaseEntity {
  25. @Column(name = "template_id",columnDefinition = "varchar(50) not null comment '模板id'")
  26. private String templateId;
  27. @Column(name = "music_id",columnDefinition = "varchar(50) not null comment '音乐id'")
  28. private String musicId;
  29. @Override
  30. public boolean equals(Object o) {
  31. if (this == o) return true;
  32. if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
  33. TemplateMusicInfo that = (TemplateMusicInfo) o;
  34. return getId() != null && Objects.equals(getId(), that.getId());
  35. }
  36. @Override
  37. public int hashCode() {
  38. return getClass().hashCode();
  39. }
  40. }