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
GORM for Hibernate can be configured with the `app/conf/application.yml` file when using Grace, the `src/main/resources/application.yml` file when using Spring Boot or by passing a `Map` or instanceof the `PropertyResolver` interface to the `org.grails.orm.hibernate.HibernateDatastore` class when used standalone.
1
+
Grace Data Hibernate can be configured with the `app/conf/application.yml` file when using Grace, the `src/main/resources/application.yml` file when using Spring Boot or by passing a `Map` or instanceof the `PropertyResolver` interface to the `org.grails.orm.hibernate.HibernateDatastore` class when used standalone.
2
2
3
3
All configuration options are read and materialized into an instance of link:{api}/org/grails/orm/hibernate/connections/HibernateConnectionSourceSettings.html[HibernateConnectionSourceSettings].
Copy file name to clipboardExpand all lines: src/docs/guide/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,6 +1,6 @@
1
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
-
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.
3
+
These are modeled in Grace Data 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.
Otherwise if you are using an earlier version of Grace framework you can force the GORM version by adding the following block directly above the `dependencies` block:
10
+
Otherwise if you are using an earlier version of Grace framework you can force the Grace Data Hibernate version by adding the following block directly above the `dependencies` block:
There are various changes you have to make to your build depending on the version of Grails when using GORM{version}.
1
+
There are various changes you have to make to your build depending on the version of Grace framework when using Grace Data Hibernate{version}.
2
2
3
-
==== Grails 3.2.x and above with Hibernate 4
3
+
==== Grace framework 2024.0.x and above with Hibernate 5.6
4
4
5
-
Grails 3.2.x is based on Spring Boot 1.4.x which enforces Hibernate 5.0.x as the default version. If you want to continue to use Hibernate 4 you must explicitly declare the Hibernate 4 dependences in `build.gradle`.
5
+
Grace framework 2024.0.x is based on Spring Boot 3.4.x which enforces Hibernate 5.6.x as the default version.
Grails 3.1.x and below are based on Spring Boot 1.3.x which enforces Hibernate 4 as the default version of Hibernate, hence you have to use explicit versions to depend on Hibernate 5:
Grails 3.0.x enforces Spring 4.1.x as the Spring version, so if you want to use Hibernate 5 you must force an upgrade to Spring 4.2.x in `build.gradle`:
34
-
35
-
[source,groovy]
36
-
.build.gradle
37
-
----
38
-
// the below is unnecessary in Grails 3.1 and above, but required in Grails 3.0.x
The `resolutionStrategy` is needed to enforce an upgrade to Spring 4.2.x which is required by Hibernate 5 support. This block is not needed if you are using Grails 3.1 or above.
Copy file name to clipboardExpand all lines: src/docs/guide/gettingStarted/outsideGrails.adoc
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,11 @@
1
-
If you wish to use GORM for Hibernate outside of a Grails application you should declare the necessary dependencies for GORM and the database you are using, for example in Gradle:
1
+
If you wish to use Grace Data Hibernate outside of a Grails application you should declare the necessary dependencies for GORM and the database you are using, for example in Gradle:
Then ensure you have configured a https://docs.spring.io/spring-boot/3.3/reference/data/sql.html[datasource and Hibernate as per the Spring Boot guide]. For example in the case of MySQL:
16
+
Then ensure you have configured a https://docs.spring.io/spring-boot/3.4/reference/data/sql.html[datasource and Hibernate as per the Spring Boot guide]. For example in the case of MySQL:
18
17
19
18
[source,yaml]
20
19
----
@@ -30,28 +29,21 @@ spring:
30
29
password: ""
31
30
----
32
31
33
-
TIP: If if you prefer to use the Grails way of configuring the `DataSource` (with `dataSource.url` etc.) then you can add `@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration)` to your `Application` class, which will allow GORM to take over configuring the data source.
34
-
35
-
Ensure your Boot `Application` class is annotated with `ComponentScan`, for example:
NOTE: Using `ComponentScan` without a value results in Boot scanning for classes in the same package or any package nested within the `Application` class package.
54
-
If your GORM entities are in a different package specify the package name as the value of the `ComponentScan` annotation.
45
+
NOTE: Using `@GraceComponentScan` without a value results in Boot scanning for classes in the same package or any package nested within the `Application` class package.
46
+
If your GORM entities are in a different package specify the package name as the value of the `@GraceComponentScan` annotation.
55
47
56
48
Finally create your GORM entities and ensure they are annotated with `grails.persistence.Entity`:
https://graceframework.org/grace-data/2023.3.x/[GORM] is a data access framework with multiple backend implementations that allows you to rapidly write data access code with little effort for your favourite database.
1
+
https://graceframework.org/grace-data/2024.0.x/[Grace Data] is a data access framework with multiple backend implementations that allows you to rapidly write data access code with little effort for your favourite database.
2
2
3
-
There are currently several implementations of GORM. This documentation covers the original implementation of GORM which is based on the https://hibernate.org/orm/[Hibernate ORM]. Below you can find links to the other implementations:
3
+
There are currently several implementations of Grace Data. This documentation covers the original implementation of Grace Data which is based on the https://hibernate.org/orm/[Hibernate ORM]. Below you can find links to the other implementations:
4
4
5
-
* https://graceframework.org/grace-data-mongodb/2023.3.x/[GORM for MongoDB]
5
+
* https://graceframework.org/grace-data-mongodb/2024.0.x/[Grace Data MongoDB]
6
6
7
-
As mentioned, https://github.com/graceframework/grace-data-hibernate[GORM for Hibernate] is the original implementation of GORM and has evolved dramatically over the years from a few meta-programming functions into a complete data access framework with multiple implementations for different datastores relational and NoSQL.
7
+
As mentioned, https://github.com/graceframework/grace-data-hibernate[Grace Data Hibernate] is the original implementation of GORM and has evolved dramatically over the years from a few meta-programming functions into a complete data access framework with multiple implementations for different datastores relational and NoSQL.
0 commit comments