尽管遵循正确的过程 model ,但没有为下面的模型创建表
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer pid;
String name;
String desc;
double price;
}

发布于 2021-09-30 04:29:08
因此,我为JPA创建了一个实体类,其中有一个字段名desc。我在使用MySQL数据库。但出于某种原因,我得到了以下错误。模型
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer pid;
String name;
String desc;
double price;
}

后来,我更改了字段名,整个工作都在进行中。ORM自动创建该表。--运行的更新模型
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer pid;
String name;
String description;
double price;
}https://stackoverflow.com/questions/69386161
复制相似问题