Anyone know of some good tutorials on how to create a custom ID generator for hibernate?
Hibernate ID Generator
Asked Answered
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.
Unfortunately the links in this answer are dead. –
Ventriloquist
@florin, that's the price you sometimes pay for linking outside of SO :-) Actually, the first and the last were still there. The second had moved so I've updated the link. The third I couldn't locate again so I've just deleted it completely. –
Sidekick
http://resource.visual-paradigm.com/vpsuite2.3sp1/custom_id_generator.html
Though this link demonstrates Visual-Paradigm tool for generating Custom ID generator, but the idea of Hibernate Custom ID generator can be learnt from the same
The link is dead :( So this answer is of no use anymore. –
Nihon
I found this one by Jiaqi Guo:
http://blog.cyclopsgroup.org/2007/04/custom-idgenerator-for-jpa-gap-between.html
@Gibbs: Link is broken –
Sulphone
I have fixed the link blog.cyclopsgroup.org/2007/04/… –
Christiechristin
© 2022 - 2024 — McMap. All rights reserved.