You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(docs): Update id.adoc
- Remove `uuid.hex` generator
- Add `uuid2` generator
- Fix some links
- Remove `source` from groovy code blocks that are not complete classes
* fix(docs): Update id.adoc
Link to correct version of the hibernate reference
Copy file name to clipboardExpand all lines: src/en/ref/Database Mapping/id.adoc
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,6 @@
1
-
2
1
== id
3
2
4
3
5
-
6
4
=== Purpose
7
5
8
6
@@ -31,7 +29,7 @@ Usage: `id(map)`
31
29
32
30
Arguments:
33
31
34
-
* `generator` (optional) - The name of the generator to use. Can be `increment`, `identity`, `sequence`, `seqhilo`, `uuid`, `uuid.hex`, `assigned`, `select`, `foreign`, `sequence-identity`, `enhanced-sequence` or `enhanced-table`. See http://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#identifiers-generators[Hibernate reference documentation] for more information.
32
+
* `generator` (optional) - The name of the generator to use. Can be `increment`, `identity`, `sequence`, `seqhilo`, `uuid`, `uuid2`, `assigned`, `select`, `foreign`, `sequence-identity`, `enhanced-sequence` or `enhanced-table`. See {hibernateReference}#identifiers-generators[Hibernate reference documentation] for more information.
35
33
36
34
WARNING: `hilo` generator was removed in Hibernate 5. See https://github.com/hibernate/hibernate-orm/blob/5.0/migration-guide.adoc[Hibernate 5 Migration Guide].
37
35
@@ -40,9 +38,9 @@ WARNING: `hilo` generator was removed in Hibernate 5. See https://github.com/hib
40
38
* `params` (optional) - Any parameters to pass to the defined identity generator
41
39
* `column` (optional) - The column name to map the identifier to. The remaining link:column.html[column] definition properties are also available.
42
40
43
-
By default GORM uses the native strategy to generate a database identifier for each entity (typically an auto-incrementing column or a sequence). You can alter this with the `id` method's `generator` argument:
41
+
By default, GORM uses the native strategy to generate a database identifier for each entity (typically an auto-incrementing column or a sequence). You can alter this with the `id` method's `generator` argument:
44
42
45
-
[source,groovy]
43
+
[,groovy]
46
44
----
47
45
static mapping = {
48
46
id generator: 'uuid'
@@ -51,7 +49,7 @@ static mapping = {
51
49
52
50
You can also use the method to define a composite identifier:
53
51
54
-
[source,groovy]
52
+
[,groovy]
55
53
----
56
54
static mapping = {
57
55
id composite: ['title', 'author']
@@ -60,7 +58,7 @@ static mapping = {
60
58
61
59
or change the name of the property that defines the identifier:
62
60
63
-
[source,groovy]
61
+
[,groovy]
64
62
----
65
63
static mapping = {
66
64
id name: 'title'
@@ -69,11 +67,11 @@ static mapping = {
69
67
70
68
You can also alter the column definition:
71
69
72
-
[source,groovy]
70
+
[,groovy]
73
71
----
74
72
static mapping = {
75
73
id column: 'book_id', type: 'integer'
76
74
}
77
75
----
78
76
79
-
See the section on http://gorm.grails.org/6.0.x/hibernate/manual/index.html#identity[Custom Database Identity] in the user guide for more information.
77
+
See the section on https://gorm.grails.org/{gormVersion}/hibernate/manual/index.html#identity[Custom Database Identity] in the user guide for more information.
0 commit comments