休眠ID生成器 [英] Hibernate ID Generator
问题描述
任何人都知道一些关于如何为hibernate创建自定义ID生成器的好教程? 解决方案
粗略搜索Google对于hibernate自定义id生成器教程,出现以下几种可能性。我已经排除了那些看起来不太有用的内容,并总结了每个内容。
希望有帮助。
Anyone know of some good tutorials on how to create a custom ID generator for hibernate?
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).
Hope that helps.
这篇关于休眠ID生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!