休眠 ID 生成器 [英] Hibernate ID Generator

查看:47
本文介绍了休眠 ID 生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道一些关于如何为休眠创建自定义 ID 生成器的好教程吗?

Anyone know of some good tutorials on how to create a custom ID generator for hibernate?

推荐答案

在 Google 上粗略搜索hibernate custom id generator tutorial"发现了以下可能性.我已经排除了那些看起来没有用的并总结了每个的内容.

A cursory search of Google for 'hibernate custom id generator tutorial' turned up the following possibilities. I've excluded those that don't look useful and summarized the content of each.

  • http://www.devx.com/Java/Article/30396 - covers the issues of generating an ID before the data is persisted (and hence does not yet have a business key).
  • http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#mapping-declaration - the whole document is very useful but not so much a tutorial as reference. Ideal when looking at the other tutorials.
  • http://www.javaworld.com/javaworld/jw-08-2008/jw-08-hibernate-annotations.html shows how to use annotations to set up your schema (including auto-generated values).

希望有所帮助.

这篇关于休眠 ID 生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆