Java Persistence with Hibernate, 2ed
ISBN: 9789351199199
608 pages
For more information write to us at: acadmktg@wiley.com
Description
Java Persistence with Hibernate, Second Edition explores Hibernate by developing an application that ties together hundreds of individual examples. You’ll immediately dig into the rich programming model of Hibernate, working through mappings, queries, fetching strategies, transactions, conversations, caching and more. Along the way you’ll find a well-illustrated discussion of best practices in database design and optimization techniques. In this revised edition, authors Christian Bauer, Gavin King and Gary Gregory cover Hibernate 5 in detail with the Java Persistence 2.1 standard (JSR 338).
Part 1 Getting Started with ORM
1 Understanding object / relational persistence
1.1 What is persistence?
1.2 The paradigm mismatch
1.3 ORM and JPA
1.4 Summary
2 Starting a project
2.1 Introducing Hibernate
2.2 “Hello World” with JPA
2.3 Native Hibernate configuration
2.4 Summary
3 Domain models and metadata
3.1 The example CaveatEmptor application
3.2 Implementing the domain model
3.3 Domain model metadata
3.4 Summary
Part 2 Mapping Strategies
4 Mapping persistent classes
4.1 Understanding entities and value types
4.2 Mapping entities with identity
4.3 Entity-mapping options
4.4 Summary
5 Mapping value types
5.1 Mapping basic properties
5.2 Mapping embeddable components
5.3 Mapping Java and SQL types with converters
5.4 Summary
6 Mapping inheritance
6.1 Table per concrete class with implicit polymorphism
6.2 Table per concrete class with unions
6.3 Table per class hierarchy
6.4 Table per subclass with joins
6.5 Mixing inheritance strategies
6.6 Inheritance of embeddable classes
6.7 Choosing a strategy
6.8 Polymorphic associations
6.9 Summary
7 Mapping collections and entity associations
7.1 Sets, bags, lists, and maps of value types
7.2 Collections of components
7.3 Mapping entity associations
7.4 Summary
8 Advanced entity association mappings
8.1 One-to-one associations
8.2 One-to-many associations
8.3 Many-to-many and ternary associations
8.4 Entity associations with Maps
8.5 Summary
9 Complex and legacy schemas
9.1 Improving the database schema
9.2 Handling legacy keys
9.3 Mapping properties to secondary tables
9.4 Summary
Part 3 Transactional Data Processing
10 Managing data
10.1 The persistence life cycle
10.2 The Entity Manager interface
10.3 Working with detached state
10.4 Summary
11 Transactions and concurrency
11.1 Transaction essentials
11.2 Controlling concurrent access
11.3 Nontransactional data access
11.4 Summary
12 Fetch plans, strategies, and profiles
12.1 Lazy and eager loading
12.2 Selecting a fetch strategy
12.3 Using fetch profiles
12.4 Summary
13 Filtering data 312
13.1 Cascading state transitions
13.2 Listening to and intercepting events
13.3 Auditing and versioning with Hibernate Envers
13.4 Dynamic data filters
13.5 Summary
Part 4 Writing Queries
14 Creating and executing queries
14.1 Creating queries
14.2 Preparing queries
14.3 Executing queries
14.4 Naming and externalizing queries
14.5 Query hints
14.6 Summary
15 The query languages
15.1 Selection
15.2 Restriction
15.3 Projection
15.4 Joins
15.5 Subselects
15.6 Summary
16 Advanced query options
16.1 Transforming query results
16.2 Filtering collections
16.3 The Hibernate criteria query API
16.4 Summary
17 Customizing SQL
17.1 Falling back to JDBC
17.2 Mapping SQL query results
17.3 Customizing CRUD operations
17.4 Calling stored procedures
17.5 Using stored procedures for CRUD
17.6 Summary
Part 5 Building Applications
18 Designing client/server applications
18.1 Creating a persistence layer
18.2 Building a stateless server
18.3 Building a stateful server
18.4 Summary
19 Building web applications
19.1 Integrating JPA with CDI
19.2 Paging and sorting data
19.3 Building JSF applications
19.4 Serializing domain model data
19.5 Summary
20 Scaling Hibernate
20.1 Bulk and batch processing
20.2 Caching data
20.3 Summary