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

Different ways to Authenticate a Web Application

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

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

CSRF Protection using Double Submitted Cookies

Why you should use BCrypt to hash passwords

CSRF Protection using Synchronizer Tokens

Use of DispatcherServlet in Spring MVC Framework

Agile Methodology – Know the What and How?