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
{{ message }}
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
For example, you could register a class `AuditEventListener` which implements `PostInsertEventListener`, `PostUpdateEventListener`, and `PostDeleteEventListener` using the following in an application:
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/caching.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
===== Setting up caching
2
2
3
3
4
-
http://www.hibernate.org/[Hibernate] features a second-level cache with a customizable cache provider. This needs to be configured in the `grails-app/conf/application.yml` file as follows:
4
+
https://www.hibernate.org/[Hibernate] features a second-level cache with a customizable cache provider. This needs to be configured in the `grails-app/conf/application.yml` file as follows:
5
5
6
6
[source,groovy]
7
7
----
@@ -15,7 +15,7 @@ hibernate:
15
15
16
16
You can customize any of these settings, for example to use a distributed caching mechanism.
17
17
18
-
NOTE: For further reading on caching and in particular Hibernate's second-level cache, refer to the http://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#caching[Hibernate documentation] on the subject.
18
+
NOTE: For further reading on caching and in particular Hibernate's second-level cache, refer to the https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#caching[Hibernate documentation] on the subject.
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/customCascadeBehaviour.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
As described in the section on <<cascades,cascading updates>>, the primary mechanism to control the way updates and deletes cascade from one association to another is the static <<ref-domain-classes-belongsTo,belongsTo>> property.
2
2
3
-
However, the ORM DSL gives you complete access to Hibernate's http://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#associations[transitive persistence] capabilities using the `cascade` attribute.
3
+
However, the ORM DSL gives you complete access to Hibernate's https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#associations[transitive persistence] capabilities using the `cascade` attribute.
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/customHibernateTypes.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
You saw in an earlier section that you can use composition (with the `embedded` property) to break a table into multiple objects. You can achieve a similar effect with Hibernate's custom user types. These are not domain classes themselves, but plain Java or Groovy classes. Each of these types also has a corresponding "meta-type" class that implements http://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/usertype/UserType.html[org.hibernate.usertype.UserType].
1
+
You saw in an earlier section that you can use composition (with the `embedded` property) to break a table into multiple objects. You can achieve a similar effect with Hibernate's custom user types. These are not domain classes themselves, but plain Java or Groovy classes. Each of these types also has a corresponding "meta-type" class that implements https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/usertype/UserType.html[org.hibernate.usertype.UserType].
2
2
3
-
The http://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#_custom_type[Hibernate reference manual] has some information on custom types, but here we will focus on how to map them in GORM. Let's start by taking a look at a simple domain class that uses an old-fashioned (pre-Java 1.5) type-safe enum class:
3
+
The https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#_custom_type[Hibernate reference manual] has some information on custom types, but here we will focus on how to map them in GORM. Let's start by taking a look at a simple domain class that uses an old-fashioned (pre-Java 1.5) type-safe enum class:
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/fetchingDSL.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ class Person {
63
63
----
64
64
If a query returns multiple `Person` instances, then when we access the first `pet` property, Hibernate will fetch that `Pet` plus the four next ones. You can get the same behaviour with eager loading by combining `batchSize` with the `lazy: false` option.
65
65
66
-
You can find out more about these options in the http://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#fetching[Hibernate user guide]. Note that ORM DSL does not currently support the "subselect" fetching strategy.
66
+
You can find out more about these options in the https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#fetching[Hibernate user guide]. Note that ORM DSL does not currently support the "subselect" fetching strategy.
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/identity.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ class Person {
19
19
20
20
In this case we're using one of Hibernate's built in 'hilo' generators that uses a separate table to generate ids.
21
21
22
-
NOTE: For more information on the different Hibernate generators refer to the http://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#identifiers-generators[Hibernate reference documentation]
22
+
NOTE: For more information on the different Hibernate generators refer to the https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#identifiers-generators[Hibernate reference documentation]
23
23
24
24
Although you don't typically specify the `id` field (GORM adds it for you) you can still configure its mapping like the other properties. For example to customise the column for the id property you can do:
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/advancedGORMFeatures/ormdsl/tableAndColumnNames.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Here `firstName` is a dynamic method within the `mapping` Closure that has a sin
41
41
===== Column type
42
42
43
43
44
-
GORM supports configuration of Hibernate types with the DSL using the type attribute. This includes specifying user types that implement the Hibernate http://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/usertype/UserType.html[org.hibernate.usertype.UserType] interface, which allows complete customization of how a type is persisted. As an example if you had a `PostCodeType` you could use it as follows:
44
+
GORM supports configuration of Hibernate types with the DSL using the type attribute. This includes specifying user types that implement the Hibernate https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/usertype/UserType.html[org.hibernate.usertype.UserType] interface, which allows complete customization of how a type is persisted. As an example if you had a `PostCodeType` you could use it as follows:
45
45
46
46
[source,java]
47
47
----
@@ -73,7 +73,7 @@ class Address {
73
73
74
74
This would make the `postCode` column map to the default large-text type for the database you're using (for example TEXT or CLOB).
75
75
76
-
See the Hibernate documentation regarding http://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#basic-explicit[Basic Types] for further information.
76
+
See the Hibernate documentation regarding https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#basic-explicit[Basic Types] for further information.
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/configuration/hibernateCustomization.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ If you are using Spring, it is registered as a Spring bean using the name `hiber
12
12
13
13
If you are not using Spring it can be passed to the constructor of the `HibernateDatastore` class on instantiation.
14
14
15
-
The `HibernateConnectionSourceFactory` has a few useful setters that allow you to specify a Hibernate http://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/Interceptor.html[Interceptor] or http://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/boot/spi/MetadataContributor.html[MetadataContributor] (Hibernate 5+ only).
15
+
The `HibernateConnectionSourceFactory` has a few useful setters that allow you to specify a Hibernate https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/Interceptor.html[Interceptor] or https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/boot/spi/MetadataContributor.html[MetadataContributor] (Hibernate 5+ only).
Copy file name to clipboardExpand all lines: docs/src/docs/asciidoc/domainClasses.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
When building applications you have to consider the problem domain you are trying to solve. For example if you were building an http://www.amazon.com/[Amazon]-style bookstore you would be thinking about books, authors, customers and publishers to name a few.
1
+
When building applications you have to consider the problem domain you are trying to solve. For example if you were building an https://www.amazon.com/[Amazon]-style bookstore you would be thinking about books, authors, customers and publishers to name a few.
2
2
3
3
These are modeled in GORM as Groovy classes, so a `Book` class may have a title, a release date, an ISBN number and so on. The next few sections show how to model the domain in GORM.
0 commit comments