Hibernate ID Generator

后端 未结 3 1232
闹比i
闹比i 2020-11-30 08:14

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

3条回答
  •  广开言路
    2020-11-30 08:35

    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.

提交回复
热议问题