Hibernate and Primary Keys

Hibernate and Primary Keys

Primary Key : 

  • Uniquely identifies each row in a table 
  • Must be a unique value
  • Cannot contain NULL values

MySQL - Auto Increment

Hibernate Identity - Primary Key









ID Generation Strategies


  • You can define your own CUSTOM generation strategy :-)
  • Create implementation of org.hibernate.id.IdentifierGenerator
  • Override the method: public Serializable generate(…)

Comments

Popular posts from this blog

Nginx

AWS Configuration For RDS(postgres),ElastiCache(Redis) with ElasticBean

Use @Initbinder in Spring MVC

CSRF Protection using Synchronizer Tokens

How to read Dates with Hibernate

CSRF Protection using Double Submitted Cookies

Add Logging Messages in Spring 5.1 - All Java Config Version

The TRUE difference between [] and {{}} bindings in Angular