Index


 
A
 
abstract classes 104
accessor methods
     adding logic to 73
     class attribute access with 383
     command pattern 318
     POJO 68
     public visibility 359
     syntax 319
     validation and 73
ACID properties 322
action servlets, writing 298
aggregate functions 272
aggregations 93, 272, 380
aliases 251, 262
AndroMDA 349
ANSI SQL
     joins 380
     standards 162
Ant task 356, 363?364, 375
APIs (application programming interfaces)
     Auditable 341
     BusinessException 310
     CompositeUserType 206
     Configuration 39
     Criteria. See Criteria APIs
     FetchMode 260?261
     FlushMode 160
     IdentifierGenerator 41
     Interceptor 158, 343?347
     Lifecycle 40
     LockMode 166
     MatchMode 255
     persistence manager 126
     PropertyAccessor 80
     Query. See Query APIs
     Session. See Session API
     SessionFactory. See SessionFactory API
     Transaction 39, 158?160
     Type 40
     UserType 203?205, 337?338
     Validatable 40
application transactions
     avoiding reassociations with new sessions 325
     choosing implementation approach 329
     defined 168, 322
     demarcating beginning of 327
     description 156
     ensuring clean Hibernate sessions 327
     flushing changes to the database 328
     granularity of 172
     handling concurrent 168
     Hibernate session closing 326
     implementing the hard way 322?323
     use case 321
     using detached objects 324
     using long sessions 325?326
     ways to implement in Hibernate applications 320
applications
     architecture 296
     cache systems and legacy 178
     client/server 41
     content management-type 178
     enterprise 120
     financial 178
     functionality requirements 155
     increasing response time of 311
     layered, design of 295?320
     legacy 250
     nonexclusive access scenarios 178
     persistence layers, interaction with 115
     persistent state 115
     scalability 161
     servlet-based 311
     web 120
association classes 225
association tables 149, 226, 366
association-level cascade style 133
associations
     bidirectional 108
     defined 220
     ensuring full initialization 300
     fetching 260?261
     foreign key 221?222
     joining 258?261
     lazy fetching 301, 386
     link tables 14
     management of 105
     many-to-many 13, 71, 225?231, 366?367
     many-to-one 13, 107, 234?235
associations (continued)
     mapping 133, 220?235
     mapping for lazy initialization 286
     multiplicity 106
     one-to-many 13, 69, 108, 231?232
     one-to-one 14, 220?223
     in POJOs 69?71
     polymorphic 105, 234?235, 237?238
     primary key 223?224
     proxying many-valued 386
     recursive 62
     ternary 230
     unidirectional 107, 232
atomicity 155, 322
attribute-oriented programming 372?376
attributes
     accessing persistent 383
     columns as 379
     embedding in source code with XDoclet 350
     index mapping 354
     inverse 109?110
     XML mapping 354
audit logging 340?341
Auditable API 341
AuditLogRecord class 341
authorization check access 383
auto commit mode 157
automated persistence 65
 
B
 
bag collections 212, 226, 228, 231
batch fetching 145, 148, 287
BLOB 199
BMP (bean-managed persistence) 20
bottom-up development 350
buffers, servlet 305
buildtime source processing 385
business domains 61
business keys 124
business layers 17, 36
business logic
     domain models 6
     migrating into domain models 306
     moving to the placeBid() method 310
     separation from control logic 305
     tiers of, separating from web tiers 312
business methods 8, 67
business models 61
business rules 296
business transactions 168
by value equality 123
bytecode processing 385
 
C
 
cache management 119
cache miss 176
cache providers 184?185, 187
cache regions 187
caching
     caution 182
     cluster setup 189?194
     concurrency and 177, 183
     eviction 181
     eviction policies 188
     first-level 178, 180
     local setup 187
     maintaining consistency across clusters 298
     methods used for lookups 334
     object identity and 176
     performance with 175
     policies 182, 185
     queries 176, 180, 290?291
     reference data 179
     second-level 178?180, 182, 193
     setting up replicated 189?194
     transaction isolation and 164, 178?179
     types of 176, 178
candidate keys 90
Cartesian products 267, 379?380
cascade attribute 110
cascade styles 133, 138
cascade, all-delete-orphan 112
cascading persistence 133
CGLIB (code generation library) project 386
classes
     abstract 104
     association 225
     attribute access 383
     authorization check access 383
     caching and 182
     coarse-grained 196
     component, writing 217
     DTO 311
     entity 196
     external state representation 383
     finder 360
     fine-grained 196
     helper 18, 296
     internal state representation 383
     modified property values validation 383
     parallel hierarchy 312
     persistence capability 115
     persistent 31, 306
     table per concrete 97?98
     tables per hierarchy 99?100
     utility 18, 296
     value type 196
classpath 47
clauses, rules governing 274
client/server applications 41
CLOB 199
cluster scope cache 176?178
clustered operations 178
cluster-safe design 298
CMP (container managed persistence) 20
CMR (container-managed relationship) 70, 106
CMT (container-managed transactions) 49, 157, 159
coarse-grained services 313
code smells 312
CodeGenerator 350
collection caches 186
collection states 123
collection wrappers 148, 150
collections
     bag 212, 226, 228, 231
     columns, avoiding not-null 219
     component 217?220, 229?230
     fetching 261
     fetching strategies for 147?148
     filtering 279?280
     indexed 232
     list 213, 228
     map 214
     nonindexed 231
     ordered 215?216
     persistent 215
     polymorphic 236?237
     set 211
     sorted 215
     value-type, mapping 211?220
columns, avoiding not-null 219
command handlers 316
command line tool execution 363
comparison operators 253?254
components
     collections of 217?221, 229?230
     unidirectional 96
composite keys 92, 330?335
CompositeUserType API 206?208
composition 93
concern leakage 65
concurrency control 161
concurrency strategies 183?184
concurrency, reducing 311
concurrent data access 161, 167
concurrent requests, problems with 328
Configuration API 39, 42
Configuration class 42
configurations
     overriding 52
     startup 42
     with properties 45
     with XML files 51
container-managed persistence (CMP) 20
container-managed relationship (CMR) 70, 106
container-managed transactions (CMT) 49, 157, 159
control logic 305
converters 202
CORBA transaction service 158
correlated subqueries 282
createAlias() method 264
createCriteria() method 263
createQuery() method 243
createSQLQuery() method 243
Criteria APIs
     comparison operators 253?254
     defined 39
     FetchMode 260
     implicit joins 266?267
     logical operators 256
     MatchMode 255
     method-chaining 244
     nesting 263
     polymorphic queries 252
     purpose of 243
     QBC and 242
     QBE and 278
     report queries 269
     restrictions 252
     results ordering 257
     SQL function calls and 255
     string matching 255
     theta-style joins 268
     where clause and 254
Criterion framework 142
cross joins, SQL 380
cross-cutting concerns 16, 64
CRUD (create, read, update, delete) 2
     automation vs hand-coding 2
     Hibernate APIs 36
     persistence manager API and 126
custom mapping types 202
 
D
 
DAO (Data Access Object) 18
data
     externalization 312
     import and export 389
     unsafe 391
data access objects (DAOs)
     automatic generation 360
     command patterns and 319
     database transaction sharing 309
     encapsulating persistence code with 307
     Hibernate session sharing 309
data definition language (DDL), SQL 379
data language 379
data manipulation language (DML), SQL 379
data transfer objects (DTOs) 21, 311?312
data transfer, DTOs and 313
database identifier equality 123
database identifier property 123
database identity 32, 88
     persistent instances and 117
     relationship with Java equality 122
     relationship with Java identity 119
database management systems 6
     schemas for SQL-based 351
database schemas, SQL 357
database transactions 127
     atomic 156
     auto commit mode 157
     DAOs and 309
     declaring boundaries of 158
     exception handling 159
     flushing the Session state 160
     granularity of 172
     JDBC API 157
     JDBC connection release 159
     JTA 157
     managed environments 159
     manager 157
     non-managed environments 159
     opening ad hoc 301
     overview 156
     roll backs 159, 163
     transaction demarcation 156
databases
     JDBC communication with 158
     legacy schemas 174
     lock tables 172
     relational 3
     triggers for 339?340
datasources 48
daylight savings and automatic versioning 390
DDL (data definition language), SQL 351, 379
DDL schemas
     Ant task and generation of 356
     creating with hbm2ddl 355?360
     generation prerequisite 352
     generation tool for 351
     mapping metadata for 352
     ORM reproduction from 351
     tools for 350
delete() method 118, 130
deletion, SQL 380
detached instances
     distinguishing from transient instances 138?139
     making transient 130
     selective reassociation of 121
     updating persistent states of 127
detached lifecycle states 196
detached objects
     defined 118
     reusing references to 121
     updating 127
detachment operation, Hibernate 119
development processes
     AndroMDA 349
     bottom-up 350
     meeting in the middle 350
     middle-out 350
     questions 389
     roundtripping 351
     tools for 349
     top-down 350
dirty checking 35, 74, 383?384
dirty read transaction issue 162
disconnect() method 325, 327
DML (data manipulation language), SQL 379
document type definition 35
domain models
     creating smart 306
     defined 61
     implementing 64?75, 196, 202
     instances, working with 323
     integration of 305?306
     mapping to given schemas 350
     migrating business logic into 306
     reproduction from DDL schemas 351
     typesafe 387
     unit testing and 64
     web tier communication with 312
DTD 76
DTO 21, 311?312
dumb data-holding objects 306
Dynabeans 391
 
E
 
eager fetching 145, 147?148, 261
EHCache 184
EJB command patterns 316?320
EJB containers 311?320
EJB session beans. See session beans (EJB)
EJBs (Enterprise Java Beans)
     development noise 316
     entity beans 20
entities
     binding persistent 247
     database-level 197
     defined 196
     hidden 197
     lifecycles of 93, 196
     root 243, 264
     software-system relevant 61
     value types compared to 93
entity associations, mapping 374
entity beans
     bean-managed persistence (BMP) 20
     code generation 364
     container-managed persistence (CMP) 20
     DTOs and 20, 311
     POJOs compared to 67
     systems that use 311
entity type systems 196
enumeration 209?211
environments
     infrastructure requirements 295
     managed 41, 48
     non-managed 42, 45
equality 122
equals() 87
equals()/hashCode() method 122, 125, 334, 359
evict() method 119
exception handling 159, 303, 305
exceptions, wrapped 316
expiry policies 187
expressions, SQL 253, 381
 
F
 
failures
     accessing databases 296
     application infrastructure 315
     business rule 315
     request checks 296
fetching strategies
     collections and 147?148
     default association 146
     eager 261
     fetch depth 149
     global 149
     lazy 261
     object retrieval 140, 143?144
     runtime association 262
     selecting in mappings 146?150
     types of 143?144
filters, servlet 304, 314
finder attribute 361
finder class 360
finder methods 360?362
fine-grained interprocess calls 313
fine-grained object models 92
flushing 160
FlushMode API 160
foreign key associations 221?222
foreign keys 268
from clauses 252, 280?281
 
G
 
get() method 140
getNamedQuery() method 249
getSession() method 314
getSessionFactory() method 314
getter methods 73?75, 125
group by clauses 273
grouping, SQL 380
 
H
 
hashCode() method 122, 125, 334
having clauses 274
hbm2ddl (SchemaExport)
     configuration options 355
     DDL schema generation with 351, 355?357
     global control of 356
     location of 352
     mapping metadata preparation 352
     middle-out development with 350
     running 352
     top-down development with 350
     uses of 351
     XML mapping attributes for 354
hbm2java (CodeGenerator)
     annotated Java class generation with 351
     bottom-up development with 350
     config option 363
     configuration file for 362
     customizability 358
     finder method generation 360
     meta-attributes and 359?360
     Middlegen generation of meta-attributes for 370
     middle-out development with 350
     output option 363
     POJO persistent class generation with 350, 358
     renderers of 362
     running 363
     uses for 358
Hello World 31
helper classes 18, 296
Hibern8IDE application 250
Hibernate
     as an open source project 389
     Q & A 389?394
     uses of 295
Hibernate extensions package 352
Hibernate Query Language (HQL) 139, 141, 242
HibernateUtil class 296, 327, 362
Hibernator plugin 250
hot standbys 192
HQL (Hibernate Query Language) 141
     aggregation, using 272
     aliases 251
     aliases and joins 262?265
     collection filters 279?281
     comparison operators 253?254
     complex queries 250
     defined 139
     distinct results, getting 271
     dynamic instantiation 271
     eager fetching 261
     expressing queries with 242
     fetch join and 260?261
     grouping 273
     implicit joins 265
     keywords, writing 251
     logical operators 256
     polymorphic queries 251
     projection 270?271
     restricting groups with having 274
     restrictions 252
     results ordering 257
     SQL function calls and 255, 272
     string matching 255
     subqueries 281
     theta-style joins 267
     where clause and 254
HttpSession 38
 
I
 
identifier attribute 32
identifier property 33
IdentifierGenerator API 41, 91
identity scopes 119
identity, database 32
ignoreCase() method 278
immediate fetching 144
inconvenient column type 337
index mapping attribute 354
indexed collections 232
inheritance
     generated code 384
     mapping 97
initialization
     ensuring full 300
     lazy 300
insertions, SQL 379
inspection, ORM 384
instance variables, accessing 383
instances
     detached 124, 138?139
     equality of 124
     mixing 122
     nontransactional 117
     persistent 124
     transient 138?139
     value-typed 197
instantiation, dynamic 271
interception 65, 384?385
Interceptor API 40, 343?345
interceptor patterns 314
Interceptor, Hibernate persistence 295
interfaces. See APIs (application programming interfaces)
inverse attribute 109
isolation
     levels 161?163, 165
isolation, transaction
     by locking 161
     cache providers and 189
     caching and 178?179
     description 161
     levels 161?163, 165
     permissible phenomena for 162
     using multiversion concurrency control 161
iterate() method 245, 289
 
J
 
Java Beans
     constructor 68
     decoupling persistent representations 383
     DTOs as 311
     POJOs 67?68
Java BluePrints (Sun) 307
Java equality 122
Java Management Extensions (JMX) 55
Java Naming and Directory Interface (JNDI). See JNDI
Java object identity 119
Java Transaction API. See JTA (Java Transaction API)
Java type systems 197
Java-based architecture 295
JavaBeans
     constructor 68
     POJOs and 67
JBoss 56, 295
JBossCache 184, 189?190, 192
JCA 295
JDBC (Java Database Connectivity)
     abstraction of functionality 37
     communication with databases 158
     connection pool 45
     connection release from transactions 159
     connections, changing the default isolation levels for 165
     marking transaction boundaries with APIs 157
     persistent objects and 127
     RowSet 6
     SQL and 5
     statement interface 16
JDBC Connections 325
JDBC drivers 246
JDBCTransactionFactory 49
JMX (Java Management Extensions) 55, 295
JNDI (Java Naming and Directory Interface)
     Hibernate integration with 295
     J2EE applications and 37
     SessionFactory binding 53
     with Tomcat 54
join conditions 258, 380
joins
     ANSI-style 258
     cross 380
     fetch 260?261
     from clause and 259
     implicit 259, 265
     inner 258
     means of expressing 259
     outer 258
     overview 258
     relational 379
     table 258
     theta-style 259, 267, 380
     using aliases with 262
     where clause and 259
JTA (Java Transaction API)
     CMTs and 157
     distributed transactions and 157
     Hibernate integration with 295
 
K
 
keys
     composite 333?338
     foreign 221?222, 268
     natural/primary 90?92, 331?332
     surrogate 91
keywords 251
 
L
 
latency 311
layered architecture 17
layers
     application 295
     business 36
     initializing 150?151
     persistence 36
     presentation 17
     separating business and presentation 296
lazy associations
     access detection 383
     fetching 384
lazy fetching 144, 146?147, 301, 386
lazy initialization 300
LazyInitializationException 300, 329
leakage of concerns 65
legacy applications 250
legacy data 330?342
legacy database schemas
     changes needed 330
     composite key mapping 333?338
     integrating database triggers with 339?340
     Middlegen and 364?371
     natural key mapping 331?332
     optimistic locking and 174
     problems with 330
     required changes 331
libraries, Hibernate 319, 375, 393
Lifecycle API 40
lifecycle states 196
link tables 14, 149, 226
list collections 213, 228
list() method 244, 289
load() method 140
lock tables 172
lock() method 128, 324
locking
     default strategy 165
     isolation by 161
     optimistic 169?172, 174
     pessimistic 165, 171
LockMode API 166?167
locks held in memory, avoiding 177
Log4j 55
logging
     discussion 54
     with Log4j 55
logic
     adding to accessor methods 73?74
     business. See business logic
     control 305
     pageflow 305
     ternary 253?254
logical operators 256
long Session 173, 325
long transactions 168
lost update transaction issue 162
 
M
 
many-to-many associations
     bidirectional 71, 227?228
     component collections used for 229?230
     mappings 197, 225?232
     restricting with Middlegen 366?367
     tables 197
     unidirectional 225
many-to-one associations 107, 234, 266?267
map collections 214
mapping
     at runtime 86
     basic properties and class 78?84
     bidirectional many-to-many 227?228
     column name 78
     component collection 217
     composite key 333?338
     entity class 197
     file name 78
     formula 79
     immutable properties 80
     inheritance 97
     legacy columns 337?338
     log record 341
     many-to-many association 197, 225?232
     metadata 75?76
     metamodels 202
     natural key 331?332
     object/relational 75
     one-to-many association 231?232
     one-to-one association 220?224
     package name 83
     synthetic identifier 332
     ternary association 230
     unidirectional many-to-many 225?226
     unidirectional one-to-many 232
mapping files, Hibernate 250, 350, 372?376
mapping metadata
     automatic generation from existing schemas 364
     DDL generation and 352
     generation customization with Middlegen 368?371
     preparation of 352?353
     XDoclet generation 372
mapping types, Hibernate
     basic 198, 200
     built-in 198
     custom, creating 202
     date and time 199
     enumerated 209?211
     Java primitive 198
     JDK 200
     large objects 199
     string 197
     system 196
     using 200?201
mass operations 181
mass updates 181
MatchMode API 255
MBean 56
memory exhaustion, preventing 181
meta-attributes
     adding to POJO source code 358
     description 371
     generation of hbm2java-specific 370
     global 362
     Xdoclet reading of 372
metadata 75
     See also mapping metadata
metamodels 86, 202
method chaining 42, 244
methods
     accessor 8, 32, 318, 359, 383
     business 8, 67
     finder 360?361
     getter 74?75, 125
     parameter-binding 245?246
     setter 74?75
Middlegen
     bottom-up development and 350
     database metadata mapping with 364
     declaring many-to-many associations in 366?367
     graphic modification of options 366?369
     GUI 364
     hbm2java-specific meta-attribute generation 370
     Hibernate plugin for 370
     legacy database schemas and 364?371
     mapping document creation with 351
     mapping generation options 368?370
     metadata graphical customization 368
     starting with Ant 364
models
     business 61
     domain. See domain models
     object 61, 92
multi-layered architecture 296
multiplicity association 106
multiversion concurrency control 161
MVC (Model/View/Controller) 298, 305
MySQL 389
 
N
 
n+1 selects problem 15, 286, 301?305
named queries 249
natural key mapping 331?332
natural keys 90
navigation
     bidirectional 218
     object graph 139, 300
     unidirectional 225?226
NIH (Not Invented Here) syndrome 19
nonstrict-read-write concurrency strategy 183
non-transactional instances 117
not-null columns, avoiding 219
null values, testing for 254
 
O
 
Object Data Management Group (ODMG) 21
object equality 87
object graphs
     navigating 139, 300
     retrieving 115, 143?144
object identity
     caching and 176
     definition 11
     object equality compared to 87
     scope of 119?120, 172
object models
     created from business models 61
     fine-grained 92
object retrieval
     by identifier and 139?140
     fetching strategies 140, 143?144
     Hibernate Criteria API and 140, 142
     HQL and 139, 141
     native SQL queries and 140
     object graph navigation 139
     operation tuning 151
     optimizing 286?293
     QBC and 142
     QBE and 143
     techniques, list of 139
     with Session 129
object states
     detached 118
     detection of, change in 383
     persistent 117
     transient 116
     types of 116
object/relational mapping (ORM)
     as middleware 23
     defined 22
     development processes 349?351
     full solutions 179
     generic problems 25
     implementations 116, 118, 383?387
     levels 24
     maintainability 27
     metadata format of 75
     object-level locking and 177
     overview 23
     performance 28
     persistence lifecycles and 116
     problems in 143
     productivity 27
     reproduction from DDL schemas 351
     triggers combined with 339
     vendor independence 28
object/relational mismatches 115
object-oriented database systems (OODBMS) 21
objects
     dereferenced 116
     lifecycles 115
     mapping 22
     persistence 115
     reattachment 121
     retrieval. See object retrieval
     states 116
     synchronization of 392
     transient. See transient objects
     types of 93
one-to-many associations 69?71, 108, 231
one-to-one associations 220?224, 266?270
onFlushDirty() method 344
onSave() method 344?345
OpenSymphony OSCache 184
operations, mass 181
operators
     comparison 253?254
     logical 256
optimistic locking 169?170, 174
order by clauses 257
ordering, SQL 380
ORM. See object/relational mapping (ORM)
outer-join loading 145
 
P
 
pageflow logic 305
pagination 243
paradigm mismatch
     cost 15
     defined 7
     entity associations 13
     granularity 9
     graph navigation 14
     identity 11
     inheritance 10
     subtypes 10
parallel class hierarchies smells 312
parameters
     binding 245?250
     named 246
     positional 247
parent/child relationships 111
persistence
     automated 65
     by reachability 131
     context 300
     defined 3
     determining type needed 64
     object-oriented 5
     transparent 65
Persistence code 307
persistence layers
     caching used by 176
     finders and 360
     handcoding with SQL/JDBC 18?19
     implementation of persistence by reachability 131
     metadata-driven applications and 387
     object/relational, performance of 175
     Persistence code isolation in 307
persistence libraries 319
persistence lifecycles 116, 131
persistence manager (Session)
     APIs 126
     database transactions compared to 120
     identical object guarantee 120
     persistent state applications and 116
     responsibility 115
     retrieving persistent objects 129
persistence manager interfaces 66
persistence-related code 295
persistent attributes, accessing 383
persistent classes 31, 123
persistent instances
     association with persistence manager 117
     caches in sessions 325
     defined 117
     new 117
     primary key value 117
     reassociation 118
     sources of 117
     synchronization with database 117
     transactional 117
     updating databases 117
persistent lifecycle states 196
persistent objects
     defined 117
     making transient 129
     retrieving. See object retrieval
     serializing graphs of, to XML files 389
     updating 129
pessimistic locking 165?166, 171
phantom read transaction issue 162
POJOs (Plain Old Java Objects)
     accessor methods 68
     adding meta-attributes to code 358?359
     associations, implementing 69?70
     command patterns 316
     DTOs as 311
     Java Beans 66?68
     making serializable 311
     persistent class generation 349?350, 358?364
     writing 67?68
polymorphic associations 11, 105, 234?235, 237?238
polymorphic collections 236?237
polymorphic queries 251
polymorphism
     mapping 234
     overview 11
postFlush() method 344
prepared statements 28
presentation layers 17
primary key associations 223
primary keys 90, 268, 390
process scope cache 176?178
process-scoped identity 118?119
projections, SQL 379?380
property values, persistent 383
PropertyAccessor API 80
proxies
     for classes 146
     from load() methods 140
     initialization of 150
     lazy fetching and 146, 386
push mechanism, automatic 393
 
Q
 
Q & A
     accessing databases live 389
     daylight savings and automatic versioning 391
     impact of large tables 390
     libraries needed on clients 393
     MySQL table locking 389
     primary keys, importance of 390
     resuming Hibernate 394
     synchronization 392
     using Dynabeans 391
QBC (query by criteria) 142, 242
QBE (query by example) 143, 242, 278
quantification 282, 381
queries
     advanced techniques 276?285
     basic operations of 380
     building with string manipulations 276
     by example 276
     caching 290?291
     comparisons between keys 268
     complex 242
     complex criteria 257
     database-specific hints 242
     dynamic 276?277
     expressing with QBC 242
     expressing with QBE 242
     externalizing strings to mapping metadata 249
     identifier value comparisons with 268
     iterating results 245, 289
     listing results 244
     named 249
     native SQL 283?284
     nested 381
     object reference comparisons with 268
     object-oriented 242
     optimizing 250
     paginating results of 243
     parameter binding 245
     polymorphic 251
     porting to mapping files 250
     QBE and dynamic 278
     reports 269
     restrictions 252
     results caching 176, 180
     results ordering 257
     root entities of criteria 243
     simplest 250
     storing 249
     using aliases 251
     using enumerated types in 210
     ways of expressing in Hibernate 242
Query APIs
     binding arbitrary arguments with 247
     creating a new instance of 243
     defined 39
     externalization of persistence concerns to 66
     iterate() method and 289
     list() method and 289
     method-chaining 244
     purpose of 243
     testing 250
query by criteria (QBC) 142, 242
query by example (QBE) 143, 242
query executions 126
 
R
 
read committed isolation level 162, 164
read uncommitted isolation level 162?163
read-only concurrency strategy 183
read-write concurrency strategy 183
reconnect() method 325, 327
recursive associations 62
reference data 179
reference to a detached object 121
referential integrity, guaranteeing 132
reflection 385
reflective systems 385
Registry pattern 53
relational data models 4, 15, 379
relational databases 3
relational joins 379
relational operations 379
relationship tables 149
relationships, managed 70
repeatable read isolation level 162, 164
report queries
     aggregation 272
     defined 269
     grouping 273
     improving performances with 275
     projection 270?271
     restricting groups with having 274
restriction criterion, SQL 381
restrictions 252, 379?380
RMI (Remote Method Invocation) 19
rollback 117, 159, 163
root entity (criteria queries) 243, 264
roundtrip development 351
runtime bytecode generation 386
runtime reflection 385
 
S
 
save() method 117, 127
saveOrUpdate() method 325
scaffolding code 69
SchemaExport 350
schemas
     database 350
     database management systems for SQL-based 351
     DDL 351
     existing 350, 364
     legacy database 364
     mapping domain models to given 350
     Middlegen and legacy database 364?371
SchemaUpdate 357
scope of object identity 119
searches
     case-insensitive 255
     string-based 255
     wildcard 255
second lost updates problem transaction issue 162
security, session beans and 313
select clauses
     calling aggregate functions in 273
     calling SQL functions from 272
     changing results with 267
     elements of results 271
     grouping and 273
     implicit joins and 259
     projection and 270
     rules governing 274
     subqueries 281
     using aliases in 263
selective reassociation of detached instances. 121
serializable isolation level 162, 164
serialization 19
servlet engines 296
servlets
     filters 304, 314
     MVC writing approach 298
     simple action 298
Session API
     as first-level cache 180
     closing 159
     database synchronization with a 159
     disconnect 174
     flexible scope of a 172
     flushing the 160
     granularity of a 172?173
     kinds of state contained in 325
     long 173, 325?328
     obtaining new instances of 296?310
     opening 304
     persistence manager. See persistence manager (Session)
     relationship with transactions 172?173
     scope 172
     serializability of 173
     SessionFactory API compared to 38
     thread-local 300?306, 325
session beans (EJB)
     command handlers 316
     session fa?ades 313
     stateless 316?317
session cache 180
session fa?ade 65
session fa?ade patterns 311, 313?316, 320
SessionFactory API
     as MBean 56
     creation of 42, 126
     initialization 296
     metamodel 87
     Session API compared to 38
     statelessness of 298
     storage of 297
session-per-application-transaction 173
session-per-request 173
session-per-request-with-detached-objects 173
set collections 211
setter method 74?75
shotgun change smells 312
single point associations 146
smells, code 312
sorted collections 215?216
source-code
     generation 349, 358?365
     processing 385
SQL (structured query language)
     aggregate functions 272
     aggregations 380
     built-in types 9
     Cartesian products 380
     DDL 379
     delete 380
     DML 379
     expressing queries with 242
     expressions 381
     generation, enabling dynamic 118
     grouping 380
     inner joins 258
     insertions 379
     JDBC and 5
     join conditions 380
     joins 258, 380
     keywords, writing 251
     logging 51
     ordering 380
     outer joins 259
     passthrough 283?284
     prepared statements 28
     projections 380
     quantification 381
     queries 380
     query hints 242
     querying 380
     relational data models 379
     relational operations 4
     restriction criterion 381
     restrictions 380
     schemas 83
     statements 118
     subselects 79, 281, 381
     table creation and management 379
     table prefix 81
     updates 379
     user-defined types (UDT) 9
SQL data type systems 197
SQL database schemas 357
SQL statements
     execution, timing of 127
startup, Hibernate 47, 77
state charts 116
static imports (JDK 1.5) 253, 257
stored procedures 6
strategy patterns 306
string matching 255
structured query language. See SQL (structured query language)
Struts 295
subclasses, tables and 101?103
subgraphs
     controlling detachment of 119
     propagating persistence to 131
subqueries 281?282
subselects 281, 381
surrogate keys 91
SwarmCache 184
Swing 295
synchronization 392
system transactions 156
 
T
 
table per class hierarchy 99?100
table per concrete class 97?98, 237?238
table per subclass 101?102
table prefix, SQL 81
tables
     as entities 197
     audit logs 340?347
     impact of large 390
     mapping with composite keys 333?338
     mapping with natural keys 331?332
     relationship 149
     restricting 366?367
     SQL creation and management of 379
ternary associations 230
ternary logic 253?254
theta-style joins 259, 267, 380
thread-local sessions 300, 309
tiers 311?312
timestamp cache 292
timestamp datatype 391
Tomcat 296
toolset, Hibernate
     hbm2ddl. See hbm2ddl (SchemaExport)
     hbm2java. See hbm2java (CodeGenerator)
     reversability of 351
     SchemaUpdate 357
     source and output artifacts 349
top-down development 350, 371
Transaction API 39, 158?160
transaction manager 157
transaction scope cache 176, 178
transactional concurrency strategy 183
transactional write-behind 36
transaction-level cache management 126
transactions
     ACID criteria 155
     ACID properties 322
     ad hoc 301
     application. See application transactions
     coarse-grained 167
     commits 159, 305
     consistency of 155
     control 126
     database. See database transactions
     defined 155, 322
     demarcation 156
     durability of 155
     EJB declarative 313
     fine-grained 167
     isolation behavior 155
     isolation of concurrent. See isolation, transaction
     lost update issue 162
     management 158
     Session API relationship with 172?173
transaction-scoped identity 119, 177, 392
transient instances 138?139
transient lifecycle states 196
transient objects
     defined 116
     making persistent 126
     transitioning to persistent objects 116
transitive persistence 131
transparent persistence 65
transparent transactional write behind 118, 160
triggers
     database 339?340
     transition 116
troubleshooting. See Q & A
try/catch blocks 305
tuples 379, 390
Type API 40
type systems 196?197
typesafe enumeration 208?210
 
U
 
UDT (user-defined types) 9
UML 61
unique constraint 354
uniqueResult() method 253
unit testing 64
units of work 155
unrepeatable read transaction issue 162
unsafe data 391
unsaved-value attribute 138?139
update() method 128, 324
updates, mass 181
updates, SQL 379
user transactions 168
user-defined types (UDT) 9
UserType API 203, 337?338
utility classes 18, 296
 
V
 
Validatable API 40
validation
     accessor methods and 73
     true data 78
value type systems 196
version checks 323
versioning
     combining with first-level session cache 164
     daylight savings and automatic 391
     legacy model 174
     managed 169?171
 
W
 
web tiers
     communication with domain models 312
     separation from business logic tiers 312
where clauses
     arithmetic expression support by 254
     calling SQL functions in 255
     evaluating expressions with 253
     expressing restrictions with 252
     restricting rows with 274
     subqueries in 281
wrapped exceptions 316
 
X
 
XDoclet
     embedded attributes in source code 350
     generation 372
     Hibernate and 376
     mapping file generation 372?376
     mapping file regeneration 351
     metadata generation 371
     overview 84?85
     running 375
     uses 376
XML
     databinding 389
     metadata and 43, 75, 352