You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.8 KiB
72 lines
1.8 KiB
package com.mathvision.diet.entity;
|
|
|
|
import com.alibaba.fastjson2.annotation.JSONField;
|
|
import com.mathvision.diet.domian.MenuDishItemDTO;
|
|
import com.vladmihalcea.hibernate.type.json.JsonStringType;
|
|
import lombok.*;
|
|
import org.hibernate.annotations.Type;
|
|
import org.hibernate.annotations.TypeDef;
|
|
|
|
import javax.persistence.*;
|
|
import java.time.Instant;
|
|
import java.util.List;
|
|
|
|
@Builder
|
|
@AllArgsConstructor
|
|
@NoArgsConstructor
|
|
@Getter
|
|
@Setter
|
|
@Entity
|
|
@TypeDef(name = "json", typeClass = JsonStringType.class)
|
|
@Table(name = "menu_dish")
|
|
public class MenuDish {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
@Column(name = "id", nullable = false)
|
|
private Long id;
|
|
|
|
@Column(name = "vender", nullable = false)
|
|
private Long vender;
|
|
|
|
@Column(name = "menu", nullable = false)
|
|
private Long menu;
|
|
|
|
@Column(name = "day", columnDefinition = "int UNSIGNED not null")
|
|
private Long day;
|
|
|
|
@Column(name = "meal", nullable = false, length = 16)
|
|
private String meal;
|
|
|
|
@Column(name = "dish", nullable = false)
|
|
private Long dish;
|
|
|
|
@Column(name = "name", nullable = false, length = 64)
|
|
private String name;
|
|
|
|
@Type(type = "json")
|
|
@Column(name = "ingredient", columnDefinition = "json", nullable = false)
|
|
private List<MenuDishItemDTO> ingredient;
|
|
|
|
@Column(name = "marks", nullable = false, length = 45)
|
|
private String marks;
|
|
|
|
@Type(type = "json")
|
|
@Column(name = "label", columnDefinition = "json")
|
|
private List<String> label;
|
|
|
|
@Column(name = "poly", nullable = false, length = 16)
|
|
private String poly;
|
|
|
|
@JSONField(serialize = false)
|
|
@Column(name = "operate", length = 45)
|
|
private String operate;
|
|
|
|
@JSONField(serialize = false)
|
|
@Column(name = "created")
|
|
private Instant created;
|
|
|
|
@JSONField(serialize = false)
|
|
@Column(name = "modify")
|
|
private Instant modify;
|
|
|
|
}
|