@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
private String id;
http://thinktothings.iteye.com/blog/1776965
2017 3 14
温故而知新
现在终于只要为啥只oracle uuid 这麽用了
JAP 只支持AUTO INDENTITY SEQUENCE TABLE
也就是说 @GeneratedValue(strategy=GenerationType.IDENTITY) 可以直接用
但是hibernater 又在JAP 的基础上添加
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
increment identity squence hilo sequilo uuid\
他们必须配合
@GenericGenerator(name = "system-uuid", strategy = "uuid")
对于name参数,是必要,他是@GeneratedValue(generator = "system-uuid") 来寻找的id