Supporting Different JPA GenerationTypes for Test/Production
问题 I want to use GenerationType.IDENTITY for primary keys in my production MySQL system. But for local development and testing, I'd like to use HSQLDB. The problem is that HSQLDB doesn't support GenerationType.IDENTITY (at least with Eclipselink). I tried setting GenerationType.AUTO, which defaults to TABLE for HSQLDB, but unfortunately it does the same for MySQL, which is not what I want. Is there some way to override this in persistence.xml? Is there some other trick I can use so that each