会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
飞飞飞飞飞
hibernate annotation生成uuid主键(id为string类型的)
hibernate annotation生成uuid主键
(2012-02-07 15:18:43)
转载
▼
标签:
uuid
主键
注解
杂谈
分类:
javaWeb
JPA标准方式下,不可以生成uuid类型的主键,但是hibernate提供了一些方式生成uuid主键,具体方式,
1,通过注解方式生成一个generator
@GenericGenerator(name="idGenerator", strategy="uuid")
2.主键生成器
@GeneratedValue(generator="idGenerator")
posted on
2015-01-27 16:24
飞飞飞飞飞
阅读(
566
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
导航
博客园
首页
新随笔
联系
订阅
管理
公告