hibernate 注释错误

yiguangtia 发布于 2014/10/06 20:30
阅读 880
收藏 0
 @Id 
    @GeneratedValue(generator ="system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")

    @Column(name="userId", unique=true, nullable=false)

    @GeneratedValue(generator ="system-uuid") 提示错误No generator named "system-uuid" is defined in the persistence unit

加载中
0
char1st
char1st

可以不理那个错误提示

http://stackoverflow.com/questions/12465048/eclipse-no-generator-named-system-uuid-is-defined-in-the-persistence-unit

0
Steve
Steve

你照这么写就好了:
@Id
@Column(name = "id", length = 36)
@javax.persistence.GeneratedValue(generator = "system-uuid")
@org.hibernate.annotations.GenericGenerator(name = "system-uuid",
strategy = "uuid2")

返回顶部
顶部