notesx - Google Code

gasownerData Management

Jan 31, 2013 (4 years and 9 months ago)

1,091 views



HIBERNATE
-

Relational Persistence for
Idiomatic Java

Hibernate Reference Documentation

by

Gavin

King
,

Christian

Bauer
,

Max

Rydahl

Andersen
,

Emmanuel

Bernard
, and

Steve

Ebersole

and thanks to

James

Cobb

(Graphic Design) and

Cheyenne

Weaver

(Graphic
Design)

3.3.2.GA

Copyright © 2004 Red Hat Middleware, LLC.

Legal Notice

June 24, 2009


Preface

1. Feedback

1. Tutorial

1.1. Part 1
-

The first Hibernate Application

1.1.1. Setup

1.1.2. The first class

1.1.3. The mapping file

1.1.4. Hibernate configuration

1.1.5. Building with Maven

1.1.6. Startup and helpers

1.1.7. Loading and storing objects

1.2. Part 2
-

Mapping associations

1.2.1. Mapping the Person class

1.2.2. A unidirectional Set
-
based association

1.2.3. Working the association

1.2.4. Collect
ion of values

1.2.5. Bi
-
directional associations

1.2.6. Working bi
-
directional links

1.3. Part 3
-

The EventManager web application

1.3.1. Writing the basic servlet

1.3.2. Proce
ssing and rendering

1.3.3. Deploying and testing

1.4. Summary

2. Architecture

2.1. Overview

2.2. Instance states

2.3. JMX Integration

2.4. JCA Support

2.5. Contextual sessions

3. Configuration

3.1. Programmatic configuration

3.2. Obtaining a SessionFactory

3.3. JDBC connections

3.4. Optional configuration properties

3.4.1. SQL Dialects

3.4.2. Outer Join Fetching

3.4.3. Binary Streams

3.4.4. Second
-
level and query cache

3.4.5. Query Language Substitution

3.4.6. Hibernate stati
stics

3.5. Logging

3.6.

Implementing a

NamingStrategy

3.7. XML configuration file

3.8. J2EE Application Server integration

3.8.1. Transaction strategy configuration

3.8.2. JNDI
-
bound

SessionFactory

3.8.3. Current Session context management with JTA

3.8.4. JMX deployment

4. Persistent Classes

4.1. A simple POJO example

4.1.1. Implement a no
-
argument constructor

4.1.2. Provide an identifier property (optional)

4.1.3.

Prefer non
-
final classes (optional)

4.1.4. Declare accessors and mutators for persistent fields (optional)

4.2. Implementing inheritance

4.3. Implementing

equals()

and

hashCode()

4.4. Dynamic models

4.5. Tuplizers

4.6. EntityNameResolvers

5. Basic O/R Mapping

5.1. Mapping declaration

5.1.1. Doctype

5.1.2. Hibernate
-
ma
pping

5.1.3. Class

5.1.4.

id

5.1.5. Enhanced identifier generators

5.1.6. Identifier generator optimization

5.1.7. composite
-
id

5.1.8. Discriminator

5.1.9. Version (optional)

5.1.10. Timestamp (optional)

5.1.11. Property

5.1.12. Many
-
to
-
one

5.1.13. One
-
to
-
one

5.1.14. Natural
-
id

5.1.15. Component and dynamic
-
component

5.1.16. Properties

5.1.17.
Subclass

5.1.18. Joined
-
subclass

5.1.19. Union
-
subclass

5.1.20. Join

5.1.21. Key

5.1.22. Column and formul
a elements

5.1.23. Import

5.1.24. Any

5.2. Hibernate types

5.2.1. Entities and values

5.2.2. Basic value types

5.2.3. Custom value types

5.3. Mapping a class more than once

5.4. SQL quoted identifiers

5.5. Metadata alternatives

5.5.1. Using XDoclet markup

5.5.2. Using

JDK 5.0 Annotations

5.6. Generated properties

5.7. Auxiliary database objects

6. Collection mapping

6.1. Persistent collections

6.2.
Collection mappings

6.2.1. Collection foreign keys

6.2.2. Collection elements

6.2.3. Indexed collections

6.2.4. Collections of values and many
-
to
-
many associations

6.2.5. One
-
to
-
many associations

6.3. Advanced collection mappings

6
.3.1. Sorted collections

6.3.2. Bidirectional associations

6.3.3. Bidirectional associations with indexed collections

6.3.4. Ternary associations

6.3.5.

Using an <idbag>

6.4. Collection examples

7. Association Mappings

7.1. Introduction

7.2. Unidirectional associations

7.2
.1. Many
-
to
-
one

7.2.2. One
-
to
-
one

7.2.3. One
-
to
-
many

7.3. Unidirectional associations with join tables

7.3.1. One
-
to
-
many

7.3.2. Many
-
to
-
one

7.3.3. One
-
to
-
one

7.3.4. Many
-
to
-
many

7.4. Bidirectional associations

7.4.1. one
-
to
-
many / many
-
to
-
one

7.4.2. One
-
to
-
one

7.5. Bidirectional associations with join tables

7.5.1. one
-
to
-
many / many
-
to
-
one

7.5.2. one to one

7.5.3. Many
-
to
-
many

7.6. More complex association mappings

8. Component Mapping

8.1. Dependent o
bjects

8.2. Collections of dependent objects

8.3. Components as Map indices

8.4. Components as composite identifiers

8.5. Dynamic components

9. Inheritance mapping

9.1. The three strategies

9.1.1. Table per class hierarchy

9.1.2. Table per subclass

9.1.3. Table per subclass: using a discriminator

9.1.4. Mixing table per class hierarchy with table per subclass

9.1.5.

Table per concrete class

9.1.6. Table per concrete class using implicit polymorphism

9.1.7. Mixing implicit polymorphism with other inheritance mappings

9.2. Limitations

10. Working with objects

10.1. Hibernate object states

10.2. Making objects persistent

10.3. Loading an object

10.4. Querying

10.4.1. Executing queries

10.4.2. Filtering collections

10.4.3. Criteria queries

10.4.4. Queries in native SQL

10.5. Modifying persisten
t objects

10.6. Modifying detached objects

10.7. Automatic state detection

10.8. Deleting persistent objects

10.9. Replicating object between two different datastores

10.10. Flushing the Session

10.11. Transitive persistence

10.12. Using metadata

11. Transactions and Concurrency

11.1. Session and transaction scopes

11.1.1. Unit of work

11.1.2. Long conversations

11.1.3. Considering object identity

11.1.4. Common issues

11.2. Database transaction demarcation

11.2.1. Non
-
managed environment

11.2.2. Using JTA

11.2.3. Exception handling

11.2.4. Transaction timeout

11.3. Optimistic concurrency control

11.3.1. Application version checking

11.3.2. Extended session and automatic versioning

11.3.3. Detached objects and automatic versioning

11.3.4. Customizing automatic versioning

11.4. Pessimistic locking

11.5. Connection release modes

12. Interceptors and events

12.1. Interceptors

12.2. Event system

12.3. Hibernate declarative security

13. Batch processing

13.1. Batch inserts

13.2. Batch updates

13.3. The StatelessS
ession interface

13.4. DML
-
style operations

14. HQL:

The
Hibernate Query
Language

14.1. Case Sensitivity

14.2. The from clause

14.3. Associations and joins

14.4. Forms of join syntax

14.5. Referring to identifier property

14.6. The select clause

14.7. Aggregate functions

14.8. Polymorphic queries

14.9. The where clause

14.10. Expressions

14.11. The order by clause

14.12. The group by clause

14.13. Subq
ueries

14.14. HQL examples

14.15. Bulk upd
ate and delete

14.16. Tips & Tricks

14.17. Components

14.18. Row value constructor syntax

15. Criteria
Queries

15.1. Creating a

C
riteria

instance

15.2. Narrowing the result set

15.3. Ordering the results

15.4. Associations

15.5. Dynamic association fetching

15.6. Example queries

15.7. Projections, aggregation and grouping

15.8. Detached queries and subqueries

15.9. Queries by natural identifier

16. Native
SQL

16.1. Using a

SQLQuery

16.1.1. Scalar queries

16.1.2. Entity queries

16.1.3. Handling associations and collections

16.1.4. Returning multiple entities

16.1.5. Returning non
-
managed entities

16.1.6. Handling
inheritance

16.1.7. Parameters

16.2. Named
SQL queries

16.2.1. Using return
-
property to explicitly specify column/alias names

16.2.2. Using stored procedures for querying

16.3. Cus
tom SQL for create, update and delete

16.4. Custom SQL for loading

17.
Filter
ing
data

17.1. Hibernate filters

1
8
.
X
M
L

M
a
p
p
i
n
g

18.1. Working with XML data

18.1.1. Specifying XML and class mapping together

18.1.2. Specifying only an XML mapping

18.2. XML mapping metadata

18.3. Manipulating XML data

1
9
.
I
m
p
r
o
v
i
n
g

p
e
r
f
o
r
m
a
n
c
e

19.1. Fetching strategies

19.1.1. Working with lazy associations

19.1.2. Tuning fetch strategies

19.1.3. Single
-
ended association proxies

19.1.4. Initializing collections and proxies

19.1.5. Using batch fetching

19.1.6. Using subselect fetching

19.1.7. Using lazy property fetching

19.2. The Second Level
Cache

19.2.1. Cache mappings

19.2.2. Strategy: read only

19.2.3. Strategy: read/write

19.2.4. Strategy: nonstrict read/write

19.2.5. Strategy: transactional

19.2.6. Cache
-
provider/concurrency
-
strategy compatibility

19.3. Managing the caches

19
.4. The Query Cache

19.5. Understanding Collection performance

19.5.1. Taxonomy

19.5.2. Lists, maps, idbags and sets are the most efficien
t collections to update

19.5.3. Bags and lists are the most efficient inverse collections

19.5.4. One shot delete

19.6. Monitoring per
formance

19.6.1. Monitoring a SessionFactory

19.6.2. Metrics

2
0
.
T
o
o
l
s
e
t

G
u
i
d
e

20.1. Automatic schema generation

20.1.1.
Customizing the schema

20.1.2. Running the tool

20.1.3. Properties

20.1.4. Using Ant

20.1.5. Incremental schema updates

20.1.
6. Using Ant for incremental schema updates

20.1.7. Schema validation

20.1.8. Using Ant for schema validation

2
1
.
E
x
a
m
p
l
e
:
P
a
r
e
n
t
/
C
h
i
l
d

21.1. A note about collections

21.2. Bidirectional one
-
to
-
many

21.3. Cascading life cycle

21.4. Cascades and

unsaved
-
value

21.5. Conclusion

2
2
.
E
x
a
m
p
l
e
:
W
e
b
l
o
g

A
p
p
l
i
c
a
t
i
o
n

22.1. Persistent Classes

22.2. Hibernate Mappings

22.3. H
ibernate Code

2
3
.
E
x
a
m
p
l
e
:
V
a
r
i
o
u
s

M
a
p
p
i
n
g
s

23.1. Employer/Employee

23.
2. Author/Work

23.3. Customer/Order/Product

23.4. Miscellaneous example mappings

23.4.1. "Typed" one
-
to
-
one association

23.4.2. Composite key example

23.4.3. Many
-
to
-
many with shared composite key attribute

23.4.4. Content based discrimination

23.4.5. Associations on alternate keys

2
4
.
B
e
s
t

P
r
a
c
t
i
c
e
s

2
5
.
D
a
t
a
b
a
s
e

P
o
r
t
a
b
i
l
i
t
y

C
o
n
s
i
d
e
r
a
t
i
o
n
s

25.1. Po
rtability Basics

25.2. Dialect

25.3. Dialect resolution

25.4.

Identifier generation

25.5. Database functions

25.6. Type mappings

R
e
f
e
r
e
n
c
e
s

P
r
e
f
a
c
e

W
o
r
k
i
n
g

w
i
t
h

o
b
j
e
c
t
-
o
r
i
e
n
t
e
d

s
o
f
t
w
a
r
e

a
n
d

a

r
e
l
a
t
i
o
n
a
l

d
a
t
a
b
a
s
e

c
a
n

b
e

c
u
m
b
e
r
s
o
m
e

a
n
d

t
i
m
e

c
o
n
s
u
m
i
n
g

i
n

t
o
d
a
y
'
s

e
n
t
e
r
p
r
i
s
e

e
n
v
i
r
o
n
m
e
n
t
s
.
H
i
b
e
r
n
a
t
e

i
s

a
n

O
b
j
e
c
t
/
R
e
l
a
t
i
o
n
a
l

M
a
p
p
i
n
g

t
o
o
l

f
o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
s
.

1
.

F
e
e
d
b
a
c
k

U
s
e

H
i
b
e
r
n
a
t
e

J
I
R
A

t
o

r
e
p
o
r
t

e
r
r
o
r
s

o
r

r
e
q
u
e
s
t

e
n
h
a
c
e
m
e
n
t
s

t
o

t
h
i
s

d
o
c
u
m
e
n
t
a
t
i
o
n
.

C
h
a
p
t
e
r

1
.

T
u
t
o
r
i
a
l

1
.
1
.
P
a
r
t

1

-

T
h
e

f
i
r
s
t

H
i
b
e
r
n
a
t
e

A
p
p
l
i
c
a
t
i
o
n

1.1.1.
Setup

1.1.2. The first class

1.1.3. The mapping file

1.1.4. Hibernate configuration

1.1.5. Building with Maven

1
.1.6. Startup and helpers

1.1.7. Loading and storing objects

1
.
2
.
P
a
r
t

2

-

M
a
p
p
i
n
g

a
s
s
o
c
i
a
t
i
o
n
s

1.2.1. Mapping the Person class

1.2.2. A unidirectional Set
-
based association

1.2.3. Working the association

1.2.4. Collection of values

1.2.5. Bi
-
directional associations

1.2.6. Working bi
-
dir
ectional links

1
.
3
.
P
a
r
t

3

-

T
h
e

E
v
e
n
t
M
a
n
a
g
e
r

w
e
b

a
p
p
l
i
c
a
t
i
o
n

1.3.1. Writing the basic servlet

1.3.2. Processing and rendering

1.3.3. Deploying and testing

1
.
4
.
S
u
m
m
a
r
y

I
n
t
e
n
d
e
d

f
o
r

n
e
w

u
s
e
r
s
,
t
h
i
s

c
h
a
p
t
e
r

p
r
o
v
i
d
e
s

a
n

s
t
e
p
-
b
y
-
s
t
e
p

i
n
t
r
o
d
u
c
t
i
o
n

t
o

H
i
b
e
r
n
a
t
e
,
s
t
a
r
t
i
n
g

w
i
t
h

a

s
i
m
p
l
e

a
p
p
l
i
c
a
t
i
o
n

u
s
i
n
g

a
n

i
n
-
m
e
m
o
r
y

d
a
t
a
b
a
s
e
.
T
h
e

t
u
t
o
r
i
a
l

i
s

b
a
s
e
d

o
n

a
n

e
a
r
l
i
e
r

t
u
t
o
r
i
a
l

d
e
v
e
l
o
p
e
d

b
y

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

t
h
a
t

r
e
p
r
e
s
e
n
t
s

t
h
e

e
v
e
n
t

w
e

w
a
n
t

t
o

s
t
o
r
e

i
n

t
h
e

d
a
t
a
b
a
s
e
;
i
t

i
s

a

s
i
m
p
l
e

J
a
v
a
B
e
a
n

c
l
a
s
s

w
i
t
h

s
o
m
e

p
r
o
p
e
r
t
i
e
s
:

p
a
c
k
a
g
e

o
r
g
.
h
i
b
e
r
n
a
t
e
.
t
u
t
o
r
i
a
l
.
d
o
m
a
i
n
;


i
m
p
o
r
t

j
a
v
a
.
u
t
i
l
.
D
a
t
e
;


p
u
b
l
i
c

c
l
a
s
s

E
v
e
n
t

{


p
r
i
v
a
t
e

L
o
n
g

i
d
;



p
r
i
v
a
t
e

S
t
r
i
n
g

t
i
t
l
e
;


p
r
i
v
a
t
e

D
a
t
e

d
a
t
e
;



p
u
b
l
i
c

E
v
e
n
t
(
)

{
}



p
u
b
l
i
c

L
o
n
g

g
e
t
I
d
(
)

{


r
e
t
u
r
n

i
d
;





}



p
r
i
v
a
t
e

v
o
i
d

s
e
t
I
d
(
L
o
n
g

i
d
)

{


t
h
i
s
.
i
d

=

i
d
;





}



p
u
b
l
i
c

D
a
t
e

g
e
t
D
a
t
e
(
)

{


r
e
t
u
r
n

d
a
t
e
;





}



p
u
b
l
i
c

v
o
i
d

s
e
t
D
a
t
e
(
D
a
t
e

d
a
t
e
)

{


t
h
i
s
.
d
a
t
e

=

d
a
t
e
;





}



p
u
b
l
i
c

S
t
r
i
n
g

g
e
t
T
i
t
l
e
(
)

{


r
e
t
u
r
n

t
i
t
l
e
;





}



p
u
b
l
i
c

v
o
i
d

s
e
t
T
i
t
l
e
(
S
t
r
i
n
g

t
i
t
l
e
)

{


t
h
i
s
.
t
i
t
l
e

=

t
i
t
l
e
;





}

}

T
h
i
s

c
l
a
s
s

u
s
e
s

s
t
a
n
d
a
r
d

J
a
v
a
B
e
a
n

n
a
m
i
n
g

c
o
n
v
e
n
t
i
o
n
s

f
o
r

p
r
o
p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