欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

镁天PROJECT  

程序员文章站 2022-07-15 11:52:28
...
@Column(unique = true)
private String name;
是无用的,因为http://*.com/questions/3496028/columnunique-true-does-not-seem-to-work
Any对象只能是单向的,One-to-Many不行。

@Entity(name = "brand")
这样的写法是错误的,会报错:org.hibernate.hql.ast.QuerySyntaxException: Brand is not mapped [from Brand]
正确的写法是:
@Entity
@Table(name = "brand")