Sun Java System Application Server Platform Edition 9 Developer's Guide

Using a SERIAL Field in PostgreSQL

To use a SERIAL field in a PostgreSQL database, define the following in your entity class:

@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)

The field created is of type SERIAL, and the implicit native sequence associated with this field is of the form FullyQualifiedName_IdFieldColumnName_SEQ.