I am using Hibernate to save an object in the database. I am generating my primary key with @GeneratedValue annotation. Here is my code Vendor class I am using MS SQL Server 2012 where I have a vendor table with following columns Unchecked means its NOTNULL = true, it doesnt allow null values. Here is the code where I am