About the Authors |
|
xv | |
About the Technical Reviewer |
|
xvii | |
Acknowledgments |
|
xix | |
Introduction |
|
xxi | |
|
Chapter 1 An Introduction to Hibernate 5 |
|
|
1 | (8) |
|
Plain Old Java Objects (POJOs) |
|
|
1 | (2) |
|
Origins of Hibernate and Object/Relational Mapping |
|
|
3 | (1) |
|
Hibernate as a Persistence Solution |
|
|
4 | (1) |
|
A Hibernate Hello World Example |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (2) |
|
Chapter 2 Integrating and Configuring Hibernate |
|
|
9 | (10) |
|
The Steps Needed to Integrate and Configure Hibernate |
|
|
9 | (1) |
|
Understanding Where Hibernate Fits into Your Java Application |
|
|
10 | (1) |
|
|
10 | (7) |
|
|
11 | (6) |
|
|
17 | (1) |
|
|
18 | (1) |
|
Chapter 3 Building a Simple Application |
|
|
19 | (22) |
|
|
19 | (21) |
|
|
20 | (1) |
|
|
21 | (3) |
|
|
24 | (3) |
|
|
27 | (1) |
|
|
28 | (1) |
|
|
28 | (1) |
|
|
29 | (1) |
|
Writing Our Sample Application |
|
|
29 | (11) |
|
|
40 | (1) |
|
Chapter 4 The Persistence Life Cycle |
|
|
41 | (26) |
|
Introducing the Life Cycle |
|
|
41 | (1) |
|
Entities, Classes, and Names |
|
|
42 | (1) |
|
|
43 | (1) |
|
Entities and Associations |
|
|
44 | (7) |
|
|
51 | (3) |
|
Object Equality and Identity |
|
|
54 | (2) |
|
|
56 | (2) |
|
|
58 | (1) |
|
|
59 | (1) |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (3) |
|
Lazy Loading, Proxies, and Collection Wrappers |
|
|
65 | (1) |
|
|
66 | (1) |
|
|
66 | (1) |
|
Chapter 5 An Overview of Mapping |
|
|
67 | (12) |
|
Why Mapping Cannot Easily Be Automated |
|
|
68 | (1) |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
72 | (5) |
|
The One-to-One Association |
|
|
73 | (2) |
|
The One-to-Many and Many-to-One Association |
|
|
75 | (1) |
|
The Many-to-Many Association |
|
|
76 | (1) |
|
Applying Mappings to Associations |
|
|
77 | (1) |
|
|
77 | (1) |
|
Specification of (Database) Column Types and Sizes |
|
|
77 | (1) |
|
The Mapping of Inheritance Relationships to the Database |
|
|
77 | (1) |
|
|
78 | (1) |
|
The Use of SQL Formula-Based Properties |
|
|
78 | (1) |
|
Mandatory and Unique Constraints |
|
|
78 | (1) |
|
|
78 | (1) |
|
Chapter 6 Mapping with Annotations |
|
|
79 | (36) |
|
Creating Hibernate Mappings with Annotations |
|
|
79 | (2) |
|
|
79 | (1) |
|
|
80 | (1) |
|
|
81 | (1) |
|
JPA 2 Persistence Annotations |
|
|
81 | (25) |
|
Entity Beans with @Entity |
|
|
82 | (1) |
|
Primary Keys with @ld and @GeneratedValue |
|
|
83 | (3) |
|
Compound Primary Keys with @ld, #IdClass, or @Embeddedid |
|
|
86 | (5) |
|
Database Table Mapping with @Table and @SecondaryTable |
|
|
91 | (1) |
|
Persisting Basic Types with @Basic |
|
|
92 | (1) |
|
Omitting Persistence with @Transient |
|
|
93 | (1) |
|
Mapping Properties and Fields with @Column |
|
|
93 | (1) |
|
Modeling Entity Relationships |
|
|
94 | (6) |
|
|
100 | (3) |
|
Other JPA 2 Persistence Annotations |
|
|
103 | (2) |
|
Ordering Collections with @OrderColumn |
|
|
105 | (1) |
|
Configuring the Annotated Classes |
|
|
106 | (2) |
|
Hibernate-Specific Persistence Annotations |
|
|
108 | (5) |
|
|
108 | (1) |
|
|
108 | (5) |
|
|
113 | (2) |
|
Chapter 7 JPA Integration and Lifecycle Events |
|
|
115 | (20) |
|
The Java Persistence Architecture |
|
|
115 | (7) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
118 | (4) |
|
|
122 | (3) |
|
External Entity Listeners |
|
|
125 | (2) |
|
|
127 | (6) |
|
|
133 | (2) |
|
Chapter 8 Using the Session |
|
|
135 | (12) |
|
|
135 | (3) |
|
|
138 | (4) |
|
|
138 | (1) |
|
|
139 | (1) |
|
|
140 | (2) |
|
|
142 | (3) |
|
|
145 | (1) |
|
|
146 | (1) |
|
Chapter 9 Searches and Queries |
|
|
147 | (18) |
|
Hibernate Query Language (HQL) |
|
|
147 | (1) |
|
|
148 | (2) |
|
|
148 | (1) |
|
|
148 | (1) |
|
|
149 | (1) |
|
|
149 | (1) |
|
|
150 | (3) |
|
Logging and Commenting the Underlying SQL |
|
|
153 | (1) |
|
|
153 | (1) |
|
Commenting the Generated SQL |
|
|
154 | (1) |
|
The from Clause and Aliases |
|
|
154 | (1) |
|
The select Clause and Projection |
|
|
155 | (1) |
|
Using Restrictions with HQL |
|
|
155 | (1) |
|
|
156 | (1) |
|
Paging Through the Result Set |
|
|
157 | (1) |
|
Obtaining a Unique Result |
|
|
158 | (1) |
|
Sorting Results with the order by Clause |
|
|
158 | (1) |
|
|
159 | (1) |
|
|
160 | (1) |
|
Bulk Updates and Deletes with HQL |
|
|
160 | (1) |
|
|
161 | (2) |
|
|
163 | (2) |
|
Chapter 10 Advanced Queries Using Criteria |
|
|
165 | (16) |
|
|
165 | (12) |
|
Using Restrictions with Criteria |
|
|
168 | (7) |
|
Paging Through the Result Set |
|
|
175 | (1) |
|
Obtaining a Unique Result |
|
|
176 | (1) |
|
Sorting the Query's Results |
|
|
177 | (1) |
|
|
177 | (2) |
|
Projections and Aggregates |
|
|
179 | (1) |
|
Should You Use the Criteria API? |
|
|
180 | (1) |
|
|
180 | (1) |
|
Chapter 11 Filtering the Results of Searches |
|
|
181 | (10) |
|
|
181 | (1) |
|
Defining and Attaching Filters |
|
|
182 | (1) |
|
|
182 | (1) |
|
Filters with XML Mapping Documents |
|
|
183 | (1) |
|
Using Filters in Your Application |
|
|
183 | (1) |
|
A Basic Filtering Example |
|
|
184 | (5) |
|
|
189 | (2) |
|
Chapter 12 Leaving the Relational Database Behind: NoSQL |
|
|
191 | (18) |
|
Where Is Hibernate When It Comes to NoSQL? |
|
|
192 | (1) |
|
First Warning: NoSQL Is Not Relational, and Hibernate Is an ORM |
|
|
192 | (1) |
|
Hibernate Is not Perfect, or "Finished" |
|
|
192 | (1) |
|
|
193 | (10) |
|
|
197 | (1) |
|
|
198 | (1) |
|
|
199 | (1) |
|
|
200 | (1) |
|
|
200 | (3) |
|
|
203 | (1) |
|
What the Hibernate Native API for OGM Looks Like |
|
|
204 | (3) |
|
|
207 | (2) |
|
Chapter 13 Hibernate Envers |
|
|
209 | (10) |
|
Making Envers Available to Your Project |
|
|
209 | (2) |
|
|
211 | (2) |
|
|
213 | (1) |
|
Accessing Envers Information |
|
|
214 | (1) |
|
|
215 | (1) |
|
|
216 | (1) |
|
|
217 | (2) |
Index |
|
219 | |