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

Use @Initbinder in Spring MVC

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

Different ways to Authenticate a Web Application

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

Why you should use BCrypt to hash passwords

CSRF Protection using Double Submitted Cookies

Use of DispatcherServlet in Spring MVC Framework

CSRF Protection using Synchronizer Tokens

Agile Methodology – Know the What and How?