尽管遵循了正确的过程,但未为以下型号创建表型号
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer pid;
String name;
String desc;
double price;
}
1条答案
按热度按时间z6psavjg1#
我在为JPA创建一个实体类,其中有一个字段名desc。我使用的是MySQL数据库。但是由于某种原因,我得到了以下错误。模型
后来我更改了字段名,整个过程都正常了。ORM自动创建了表。更新后的模型正常工作