JPA Persistence Guide (V5.1) Table of Contents
Total Page:16
File Type:pdf, Size:1020Kb
JPA Persistence Guide (v5.1) Table of Contents EntityManagerFactory . 2 Create an EMF in JavaSE . 2 Create an EMF in JavaEE . 2 Persistence Unit . 3 EntityManagerFactory Properties . 6 Closing EntityManagerFactory . 26 Level 2 Cache . 26 Datastore Schema . 33 Schema Generation for persistence-unit . 33 Schema Auto-Generation at runtime . 34 Schema Generation : Validation . 34 Schema Generation : Naming Issues. 35 Schema Generation : Column Ordering . 36 Schema : Read-Only . 36 SchemaTool . 36 Schema Adaption . 43 RDBMS : Datastore Schema SPI . 43 EntityManager . 47 Opening/Closing an EntityManager . 47 Persisting an Object . 48 Persisting multiple Objects in one call . 48 Finding an object by its identity . 49 Finding an object by its class and unique key field value(s) . 49 Deleting an Object . 50 Deleting multiple Objects . 50 Modifying a persisted Object . 51 Modifying multiple persisted Objects. 51 Refreshing a persisted Object . 51 Getting EntityManager for an object . 52 Cascading Operations . 52 Orphans . 53 Managing Relationships. 53 Transactions with lots of data . 55 Level 1 Cache . 56 Object Lifecycle . 58 Transaction PersistenceContext. 58 Extended PersistenceContext . 58 Detachment . 58 Helper Methods . 59 Transactions . 60 Locally-Managed Transactions . 60 JTA Transactions . 61 Container-Managed Transactions . 63 Spring-Managed Transactions . 63 No Transactions . 63 Transaction Isolation . 64 Read-Only Transactions . 64 Flushing . 65 Transaction Savepoints . 66 Locking . 67 Optimistic Locking . 67 Pessimistic (Datastore) Locking . 68 Datastore Connections . ..