Part I Development Tasks and Tools
1. Setting Up a Development Environment
Part II Developing Applications and Application Components
6. Using the Java Persistence API
Additional Database Properties
Changing the Persistence Provider
Restrictions and Optimizations
Using @OrderBy with a Shared Session Cache
Using BLOB or CLOB Types with the Inet Oraxo JDBC Driver
Named Native Queries and JDBC Queries
7. Developing Web Applications
8. Using Enterprise JavaBeans Technology
9. Using Container-Managed Persistence
12. Developing Lifecycle Listeners
13. Developing OSGi-enabled Java EE Applications
Part III Using Services and APIs
14. Using the JDBC API for Database Access
15. Using the Transaction Service
16. Using the Java Naming and Directory Interface
In the descriptions of the @GeneratedValue, @SequenceGenerator, and @TableGenerator annotations in the Java Persistence Specification, certain defaults are noted as specific to the persistence provider. The default persistence provider's primary key generation defaults are listed here.
@GeneratedValue defaults are as follows:
Using strategy=AUTO (or no strategy) creates a @TableGenerator named SEQ_GEN with default settings. Specifying a generator has no effect.
Using strategy=TABLE without specifying a generator creates a @TableGenerator named SEQ_GEN_TABLE with default settings. Specifying a generator but no @TableGenerator creates and names a @TableGenerator with default settings.
Using strategy=IDENTITY or strategy=SEQUENCE produces the same results, which are database-specific.
For Oracle databases, not specifying a generator creates a @SequenceGenerator named SEQ_GEN_SEQUENCE with default settings. Specifying a generator but no @SequenceGenerator creates and names a @SequenceGenerator with default settings.
For PostgreSQL databases, a SERIAL column named entity-table_pk-column_SEQ is created.
For MySQL databases, an AUTO_INCREMENT column is created.
For other supported databases, an IDENTITY column is created.
The @SequenceGenerator annotation has one default specific to the default provider. The default sequenceName is the specified name.
@TableGenerator defaults are as follows:
The default table is SEQUENCE.
The default pkColumnName is SEQ_NAME.
The default valueColumnName is SEQ_COUNT.
The default pkColumnValue is the specified name, or the default name if no name is specified.