Skip to content

Commit 7dbc00f

Browse files
authored
fix(docs): Update id.adoc (#892)
* 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
1 parent c03f22e commit 7dbc00f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ asciidoctor {
120120
'docinfo1' : '',
121121
'toc' : 'left',
122122
'version' : project.version,
123-
'gormVersion' : project.gormVersion,
124123
'sourcedir' : "$checkOutDir/grails-src"
125124
}
126125

@@ -163,6 +162,7 @@ task publishGuide(type: grails.doc.gradle.PublishGuide, dependsOn: ['apiDocs', '
163162
'gormApiDocs': "https://gorm.grails.org/${gormVersion}/api/",
164163
'springbootapi' :"https://docs.spring.io/spring-boot/docs/${springBootVersion}/api",
165164
'springBootReference' :"https://docs.spring.io/spring-boot/docs/${springBootVersion}/reference",
165+
'hibernateReference': 'https://docs.jboss.org/hibernate/orm/5.6/userguide/html_single/Hibernate_User_Guide.html',
166166
'springBootVersion': project.springBootVersion,
167167
'springVersion': project.springVersion,
168168
'gradleVersion': project.gradleVersion

src/en/ref/Database Mapping/id.adoc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
21
== id
32

43

5-
64
=== Purpose
75

86

@@ -31,7 +29,7 @@ Usage: `id(map)`
3129

3230
Arguments:
3331

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.
3533

3634
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].
3735

@@ -40,9 +38,9 @@ WARNING: `hilo` generator was removed in Hibernate 5. See https://github.com/hib
4038
* `params` (optional) - Any parameters to pass to the defined identity generator
4139
* `column` (optional) - The column name to map the identifier to. The remaining link:column.html[column] definition properties are also available.
4240

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:
4442

45-
[source,groovy]
43+
[,groovy]
4644
----
4745
static mapping = {
4846
id generator: 'uuid'
@@ -51,7 +49,7 @@ static mapping = {
5149

5250
You can also use the method to define a composite identifier:
5351

54-
[source,groovy]
52+
[,groovy]
5553
----
5654
static mapping = {
5755
id composite: ['title', 'author']
@@ -60,7 +58,7 @@ static mapping = {
6058

6159
or change the name of the property that defines the identifier:
6260

63-
[source,groovy]
61+
[,groovy]
6462
----
6563
static mapping = {
6664
id name: 'title'
@@ -69,11 +67,11 @@ static mapping = {
6967

7068
You can also alter the column definition:
7169

72-
[source,groovy]
70+
[,groovy]
7371
----
7472
static mapping = {
7573
id column: 'book_id', type: 'integer'
7674
}
7775
----
7876

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

Comments
 (0)