JPA SequenceGenerator and GeneratedValue: name / generator property unique only per class?
问题 I use JPA + OpenJPA with PostgreSQL as backend RDBMS. The primary keys of my tables usually consist of a SERIAL / BIGSERIAL column. So PostgreSQL automatically generates IDs for new entries ( strategy=GenerationType.IDENTITY ). The annotations of ID property look like this: @Id @SequenceGenerator(name="myseq",sequenceName="foobartable_fooid_seq") @GeneratedValue(generator="myseq",strategy=GenerationType.IDENTITY) My question is: Can I copy and paste this annotations block to several entities,