Added by on 2013-07-05

How to add a UNIQUE field?

@GeneratedValue
//It generates a unique value

How to add a UNIQUE primary key field and make it auto-complete?

@GeneratedValue(strategy=GenerationType.AUTO)
//It generates a unique value. The values = last value + 1

Check what’s the meaning of:

@TableGenerator(name="", table="", pkColumnName, pkColumnValue, allocationSize=)

Category:

Hibernate

Tags:

, ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*