Skip to content

Commit 4fadcec

Browse files
committed
HHH-9998 - Continue documentation TLC - mapping identifiers
1 parent 4f72533 commit 4fadcec

File tree

13 files changed

+495
-21
lines changed

13 files changed

+495
-21
lines changed

documentation/src/main/docbook/integration/en-US/Hibernate_Integrations.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
<xi:include href="chapters/services/Services.xml" />
4848

4949
<!--
50+
org.hibernate.boot.model.IdGeneratorStrategyInterpreter
51+
52+
custom Session/SessionFactory implementators
53+
5054
<xi:include href="chapters/types/Custom_Types.xml" />
5155
-->
5256

documentation/src/main/docbook/manual/en-US/chapters/portability/Portability.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,8 @@
193193
JPA portability
194194
* HQL/JPQL differences
195195
* naming strategies
196+
* basic types
197+
* simple id types
198+
* generated id types
199+
* "embedded composite identifiers"
196200
</chapter>

documentation/src/main/docbook/mapping/en-US/chapters/basic/Basic_Types.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
88
-->
99
<chapter xml:id="basic" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
10-
<title>Basic Types</title>
11-
12-
<abstract>
13-
This chapter will discuss actual basic type mappings as well as how to override those
14-
mappings and provide extra mappings.
15-
</abstract>
10+
<info>
11+
<title>Basic Types</title>
12+
<abstract>
13+
<para>
14+
This chapter will discuss actual basic type mappings as well as how to override those
15+
mappings and provide extra mappings.
16+
</para>
17+
</abstract>
18+
</info>
1619

1720
<para>
1821
Basic value types usually map a single database value, or column, to a single, non-aggregated Java
@@ -1002,7 +1005,7 @@
10021005
<title>UUID as identifier</title>
10031006
<para>
10041007
Hibernate supports using UUID values as identifiers. They can even be generated! For
1005-
details see the discussion of generators in <xref linkend="identifiers"/>
1008+
details see the discussion of generators in <xref linkend="identifiers-generators"/>
10061009
</para>
10071010
</section>
10081011
</section>

documentation/src/main/docbook/mapping/en-US/chapters/id/Identifiers.xml

Lines changed: 407 additions & 14 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@Entity
2+
public class MyEntity {
3+
@Id
4+
@GeneratedValue(generation=SEQUENCE, name="my_sequence")
5+
@SequenceGenerator( name = "my_sequence", schema = "globals", allocationSize = 30 )
6+
public Integer id;
7+
...
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@Entity
2+
public class MyEntity {
3+
@Id
4+
@GeneratedValue(generation=SEQUENCE, name="my_sequence")
5+
public Integer id;
6+
...
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@Entity
2+
public class MyEntity {
3+
@Id
4+
public Integer id;
5+
...
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@Entity
2+
public class MyEntity {
3+
@Id
4+
@GeneratedValue
5+
public Integer id;
6+
...
7+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
create table hibernate_sequences(
2+
sequence_name VARCHAR NOT NULL,
3+
next_val INTEGER NOT NULL
4+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@Entity
2+
public class MyEntity {
3+
@Id
4+
@GeneratedValue( generator="uuid" )
5+
@GenericGenerator(
6+
name="uuid",
7+
strategy="org.hibernate.id.UUIDGenerator",
8+
parameters = {
9+
@Parameter(
10+
name="uuid_gen_strategy_class",
11+
value="org.hibernate.id.uuid.CustomVersionOneStrategy"
12+
)
13+
}
14+
)
15+
public UUID id;
16+
...
17+
}

0 commit comments

Comments
 (0)