What is the prime difference between a @TableGenerator and a @SequenceGenerator and what they ultimately do is to generate a primary key for which the AUTO would do the same thing. Can you please help me differentiate the importance.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
If you read about both annotations, you'll see that @TableGenerator uses a table to hold primary keys. The next primary key value will be taken from that table and incremented. @SequenceGenerator uses a database sequence (like Oracle sequences) to generate primary keys. Setting the generation type (GenerationType) to AUTO will let the persistence provider choose for you which type to use. You can implicitly tell it which type to use via either IDENTITY, TABLE or SEQUENCE. If you do so, you have to check that your persistence provider supports the GenerationType.