Skip to content

Commit da51960

Browse files
committed
Update docs
1 parent c0cb6ad commit da51960

17 files changed

+44
-90
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The following sections cover more advanced usages of GORM including caching, custom mapping and events.
1+
The following sections cover more advanced usages of Grace Data including caching, custom mapping and events.

src/docs/guide/configuration.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
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.
22

33
All configuration options are read and materialized into an instance of link:{api}/org/grails/orm/hibernate/connections/HibernateConnectionSourceSettings.html[HibernateConnectionSourceSettings].

src/docs/guide/constraints.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Constraints are how you define validation when using GORM entities.
1+
Constraints are how you define validation when using Grace Data entities.

src/docs/guide/domainClasses.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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.
22

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

55
Consider the following domain class:
66

src/docs/guide/gettingStarted.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
To use GORM {version} for Hibernate in Grace 2023 you can specify the following configuration in `build.gradle`:
1+
To use Grace Data Hibernate {version} in Grace applications you can specify the following configuration in `build.gradle`:
22

33
[source,groovy,subs="attributes"]
44
----
55
dependencies {
6-
compile "org.graceframework.plugins:hibernate:{version}"
6+
implementation "org.graceframework:grace-boot-hibernate:{version}"
77
}
88
----
99

10-
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:
1111

1212
[source,groovy,subs="attributes"]
1313
.build.gradle
1414
----
15-
ext['grace-gorm.version'] = {version}
15+
ext['grace-data-hibernate.version'] = {version}
1616
----
Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,13 @@
1-
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}.
22

3-
==== Grails 3.2.x and above with Hibernate 4
3+
==== Grace framework 2024.0.x and above with Hibernate 5.6
44

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

77
[source,groovy]
88
.build.gradle
99
----
1010
dependencies {
11-
compile "org.grails.plugins:hibernate4"
12-
compile "org.hibernate:hibernate-core:4.3.10.Final"
13-
compile "org.hibernate:hibernate-ehcache:4.3.10.Final"
11+
implementation "org.graceframework:grace-boot-hibernate"
1412
}
1513
----
16-
17-
==== Grails 3.1.x and below with Hibernate 5
18-
19-
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:
20-
21-
[source,groovy]
22-
.build.gradle
23-
----
24-
dependencies {
25-
compile "org.grails.plugins:hibernate5"
26-
compile "org.hibernate:hibernate-core:5.1.0.Final"
27-
compile "org.hibernate:hibernate-ehcache:5.1.0.Final"
28-
}
29-
----
30-
31-
==== Grails 3.0.x Spring Version Conflicts
32-
33-
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
39-
configurations.all {
40-
resolutionStrategy {
41-
eachDependency { DependencyResolveDetails details ->
42-
if(details.requested.group == 'org.springframework') {
43-
details.useVersion('4.2.3.RELEASE')
44-
}
45-
}
46-
}
47-
}
48-
----
49-
50-
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.

src/docs/guide/gettingStarted/outsideGrails.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff 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:
22

33
[source,groovy,subs="attributes"]
44
----
5-
compile "org.grails:grails-datastore-gorm-hibernate5:{version}"
6-
runtime "com.h2database:h2:1.4.192"
7-
runtime "org.apache.tomcat:tomcat-jdbc:8.5.0"
8-
runtime "org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.0"
9-
runtime "org.slf4j:slf4j-api:1.7.10"
5+
implementation "org.graceframework:grace-boot:{version}"
6+
implementation "org.graceframework:grace-boot-hibernate:{version}"
7+
implementation "org.graceframework:grace-boot-persistence:{version}"
8+
runtimeOnly "com.h2database:h2:2.3.232"
109
----
1110

1211
NOTE: The above example also uses the https://www.h2database.com[H2 Database] and Tomcat connection pool.

src/docs/guide/gettingStarted/springBoot.adoc

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
To use GORM for Hibernate in Spring Boot add the necessary dependencies to your Boot application:
1+
To use Grace Data Hibernate in Spring Boot add the necessary dependencies to your Boot application:
22

33
[source,groovy,subs="attributes"]
44
----
5-
compile("org.grails:gorm-hibernate5-spring-boot:{version}")
6-
compile "org.hibernate:hibernate-core"
7-
compile "org.hibernate:hibernate-ehcache"
8-
runtime "com.h2database:h2:1.4.192"
5+
implementation "org.graceframework:grace-boot:{version}"
6+
implementation "org.graceframework:grace-boot-hibernate:{version}"
7+
implementation "org.hibernate:hibernate-jcache"
8+
runtimeOnly "com.h2database:h2"
99
// for MySQL
10-
// runtime "mysql:mysql-connector-java"
10+
// runtimeOnly "mysql:mysql-connector-java"
1111
1212
// for connection pooling
13-
runtime "org.apache.tomcat:tomcat-jdbc:8.5.0"
14-
runtime "org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.0"
13+
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
1514
----
1615

17-
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:
1817

1918
[source,yaml]
2019
----
@@ -30,28 +29,21 @@ spring:
3029
password: ""
3130
----
3231

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:
36-
3732
[source,groovy]
3833
----
3934
import org.springframework.boot.SpringApplication
40-
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
41-
import org.springframework.context.annotation.*
35+
import org.springframework.boot.autoconfigure.SpringBootApplication
4236
43-
@Configuration
44-
@EnableAutoConfiguration
45-
@ComponentScan
37+
@SpringBootApplication
4638
class Application {
4739
static void main(String[] args) {
4840
SpringApplication.run Application, args
4941
}
5042
}
5143
----
5244

53-
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.
5547

5648
Finally create your GORM entities and ensure they are annotated with `grails.persistence.Entity`:
5749

src/docs/guide/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= GORM for Hibernate
1+
= Grace Data Hibernate
22
Graeme Rocher, Puneet Behl
33
:imagesdir: ./images
44
:source-highlighter: coderay

src/docs/guide/introduction.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
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.
22

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

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]
66
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

Comments
 (0)