Anyone know of some good tutorials on how to create a custom ID generator for hibernate?
+1
A:
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
Rutesh Makhijani
2009-01-30 13:57:44
+1
A:
A cursory search of Google for 'hibernate custom id generator tutorial' (which, honestly, you could have done yourself :-), 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://www.hibernate.org/hib_docs/v3/reference/en/html_single/#mapping-declaration-id-generator - the whole document is very useful but not so much a tutorial as reference. Ideal when looking at the other tutorials.
- http://metaarchit.com/hibernate_tutorials/Hibernate%20Tutorial%2003.pdf - this is a short (8-page) tutorial showing how to use generated keys rather than business keys.
- 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.
paxdiablo
2009-02-04 02:46:17