正在加载图片...
xiv CONTENTS Manipulating entities with EntityManager 293 9.1 Introducing the EntityManager 294 in ActionBazaar 303 9.2 Creating Entity Manager instances 304 Container-managed EntityManagers 305 Applicntion-managed EntityManager 308 9.3 Managing persistence operations 313 Persisting entities 314.Retrieving entities by primary key 319 Updating entities 325.Deleting entities 328 Controlling updates with flush 330 Refreshing entities 331 9.4 Entity lifecycle listeners 333 Using an entity listener 334.Default listener classes 336 Listener class execution order and exclusion 337 9.5 Entity operations best practices8 9.6 Summary 338 10 Using the query API and JPOL to retrieve entities 340 10.1 Introducing the query API 341 The big picture 341.Anatomy of a query 343 Defining named queries 344 10.2 Executing the queries 345 Creating a query instance 346.Working with the Que叮interface347·Specifying query hints353 10.3 Introducing JPQL 354 Defining statement types 356.Using the FROM clause 358 Conditional expressions and operators 562.Working with POL functions 367 Using a SELECT clause 370 Using aggregations 372"Ordering the query result 374 Using subqueries 374.Joining entities 376 Bulk updates and deletes 379 10.4 Native SQL queries 380 Using dynamic queries with native SQL 381Using a named native SQL que叮382 10.5 Summary 383 xiv CONTENTS 9 Manipulating entities with EntityManager 293 9.1 Introducing the EntityManager 294 The EntityManager interface 294 ■ The lifecycle of an entity 297 ■ Persistence contexts, scope, and the EntityManager 301 ■ Using the EntityManager in ActionBazaar 303 9.2 Creating EntityManager instances 304 Container-managed EntityManagers 305 Application-managed EntityManager 308 9.3 Managing persistence operations 313 Persisting entities 314 ■ Retrieving entities by primary key 319 Updating entities 325 ■ Deleting entities 328 Controlling updates with flush 330 ■ Refreshing entities 331 9.4 Entity lifecycle listeners 333 Using an entity listener 334 ■ Default listener classes 336 Listener class execution order and exclusion 337 9.5 Entity operations best practices 338 9.6 Summary 338 10 Using the query API and JPQL to retrieve entities 340 10.1 Introducing the query API 341 The big picture 341 ■ Anatomy of a query 343 Defining named queries 344 10.2 Executing the queries 345 Creating a query instance 346 ■ Working with the Query interface 347 ■ Specifying query hints 353 10.3 Introducing JPQL 354 Defining statement types 356 ■ Using the FROM clause 358 Conditional expressions and operators 362 ■ Working with JPQL functions 367 ■ Using a SELECT clause 370 Using aggregations 372 ■ Ordering the query result 374 Using subqueries 374 ■ Joining entities 376 Bulk updates and deletes 379 10.4 Native SQL queries 380 Using dynamic queries with native SQL 381 ■ Using a named native SQL query 382 10.5 Summary 383
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有