@Table(name = "t_foodtype")
@Entity
public class FoodType implements IEntity<Integer> {
private static final long serialVersionUID = -2542562223727790555L;
//默认初始化有早餐、午餐、晚餐、夜宵、饮料,然后其id默认是1、2、3、4、5,因为是全部学校共用的,所以schoolid为0
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
//菜式分类的名称,比如早餐、午餐、晚餐、夜宵、饺子、麻辣烫等,默认初始化有早餐、午餐、晚餐、夜宵、饮料
@Column(length = 16, nullable = false, name = "name")
private String name;
//0为主食、1为零食、2为日用品
@Column(nullable = true, name = "type")
private Integer type;
//0为不显示,1或null为显示
@Column(nullable = true, name = "noshow")
private Integer noshow;
@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL }, mappedBy = "foodType")
private Set<Food> foods;
//学校id
@Column(nullable = false, name = "schoolid")
private Integer schoolId;
//菜式卡列表中展示的图片
@Column(length = 256, nullable = true, name = "path")
private String path;
//根据这个条件来排序再copy插入新学校的菜式卡列表
@Column(nullable = true, name = "orderid")
private Integer orderid;
public FoodType() {
}
public FoodType(String name, Integer type, Integer noshow, Integer schoolId) {
super();
this.name = name;
this.type = type;
this.noshow = noshow;
this.schoolId = schoolId;
}
public FoodType(String name, Integer type, Integer noshow, Set<Food> foods,
Integer schoolId, String path) {
super();
this.name = name;
this.type = type;
this.noshow = noshow;
this.foods = foods;
this.schoolId = schoolId;
this.path = path;
}
public FoodType(String name, Integer type, Integer noshow, Set<Food> foods,
Integer schoolId, String path, Integer orderid) {
super();
this.name = name;
this.type = type;
this.noshow = noshow;
this.foods = foods;
this.schoolId = schoolId;
this.path = path;
this.orderid = orderid;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Set<Food> getFoods() {
return foods;
}
public void setFoods(Set<Food> foods) {
this.foods = foods;
}
public Integer getSchoolId() {
return schoolId;
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public Integer getNoshow() {
return noshow;
}
public void setNoshow(Integer noshow) {
this.noshow = noshow;
}
public Integer getOrderid() {
return orderid;
}
public void setOrderid(Integer orderid) {
this.orderid = orderid;
}
}
求以下class的mysql表结构
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- blue小脚丫 2016-07-27 03:11关注
主要你得明白各个注解的意思,这样子自己很容易就能知道实体类对应的表结构了。
drop table if exists t_foodtype; create table t_foodtype ( id int not null, name varchar(16) not null, type int, noshow int, schoolid int not null, path varchar(256), orderid int, primary key (id) );
解决 无用评论 打赏 举报
悬赏问题
- ¥15 csmar数据进行spss描述性统计分析
- ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
- ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
- ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
- ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
- ¥15 运动想象脑电信号数据集.vhdr
- ¥15 三因素重复测量数据R语句编写,不存在交互作用
- ¥15 微信会员卡等级和折扣规则
- ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
- ¥15 随身WiFi网络灯亮但是没有网络,如何解决?