Why you might want to use negative id numbers for Test Data

We ran into an issue with our Primary Key generation today when running our application on PostgreSQL versus our development database HSQLDB.

We solved it by changing all our test data’s surrogate primary keys to negatives.

Here’s the details GenerationType behaves differently on different databases (link to follow – Technologies/Hibernate/Selecting a Primary Key Generation Type)

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply