Tutorialspoint examples

Learn java tutorial with examples for beginners online

JPA TableGenerator annotation

The TableGenerator defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation. A table generator may be specified on the entity class or on the primary key field or property. The scope of the generator name is global to the persistence unit (across all generator types).The TableGenerator annotation uses a standard database table for primary key values.


@GeneratedValue(strategy=GenerationType.TABLE , generator="employee_generator")
private Integer studentId;


Name: A unique generator name that can be referenced by one or more classes to be the generator for primary key values. It is a required attribute.

Posted in JPA   
Download tutorialspointexamples Android App
Copyright © 2018 Tutorialspoint examples DMCA.com Protection Status