JPA / Hibernate / Derby TableGenerator use negative values
问题 I want any generated primary keys in my database to be negative integers. I defined a TableGenerator: <table-generator name="MY_SEQ" table="MY_SEQUENCE_TABLE" initial-value="-1000000" allocation-size="1" /> I assumed this would start the first generated key at -1000000 and increment each id by 1. So the next id would be -999999. When I create and persist a new entity I get the following error: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have