Skip to content

Commit 1ec34e9

Browse files
committed
Update the Upgrade Notes
1 parent e6aa69a commit 1ec34e9

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

src/docs/guide/introduction/upgradeNotes.adoc

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
==== Dependency Upgrades
1+
=== Dependency Upgrades
22

3-
GORM 2023.3 supports Apache Groovy 4 and Java 17 Hibernate 5.6.x and Spring 6.1.x.
3+
GORM 2023.3 supports Apache Groovy 4 and Java 17, Hibernate 5.6.x and Spring 6.1.x.
44

55
Each of these underlying components may have changes that require altering your application. These changes are beyond the scope of this documentation.
66

7-
==== Default Autowire By Type inside GORM Data Services
7+
=== Default Autowire By Type inside GORM Data Services
88

99
A GORM Service (or a bean) inside GORM DataService will default to autowire by-type, For example:
1010

1111
_./app/services/example/BookService.groovy_
12-
```
12+
[source,groovy]
13+
----
1314
package example
1415
1516
import grails.gorm.services.Service
@@ -25,6 +26,48 @@ abstract class BookService {
2526
assert testRepo != null
2627
}
2728
}
28-
```
29+
----
2930

3031
Please note that with autowire by-type as the default, when multiple beans for same type are found the application with throw Exception. Use the Spring `@Qualifier` annotation for https://docs.spring.io/spring-framework/reference/6.1/core/beans/annotation-config/autowired-qualifiers.html[Fine-tuning Annotation Based Autowiring with Qualifiers].
32+
33+
=== JPA-annotated Entites are not supported
34+
35+
Support for using JPA-annotated entites written in Groovy has been added since GORM 6.1, but this feature has been removed since GORM 2023.0.
36+
37+
We want to keep GORM focusing on Groovy DSL, this allow developers to use JPA entities written in Java in the `app/domain`, so we can use Spring Data JPA or Micronaut Data JPA.
38+
39+
=== Initial support for Groovy 5
40+
41+
Groovy 5.0 is the next major version, it's currently in beta, but you can try it in the Grace applications.
42+
43+
=== Auto-Configure Hibernate Plugin
44+
45+
GORM 2023.1.0 introduced `HibernateGormAutoConfiguration` as a Spring Boot's https://docs.spring.io/spring-boot/3.3/reference/features/developing-auto-configuration.html[Auto-configuration], and the Hibernate plugin has also provides https://docs.spring.io/spring-boot/3.3/specification/configuration-metadata/index.html[Configuration Metadata].
46+
47+
Most importantly, you can now easily use GORM for Hibernate in your Spring Boot application.
48+
49+
[source,groovy,subs="attributes"]
50+
----
51+
dependencies {
52+
implementation 'org.apache.groovy:groovy'
53+
implementation 'org.graceframework.plugins:hibernate:{version}'
54+
runtimeOnly 'com.h2database:h2'
55+
}
56+
----
57+
58+
=== Support `@GrailsComponentScan`
59+
60+
GORM 2023.1.0 use `@GrailsComponentScan` to customize GORM `@Entity` scanning locations, just like Spring's link:{springjavadoc}/org/springframework/context/annotation/ComponentScan.html[`@ComponentScan`] does.
61+
62+
_./app/init/example/Application.groovy_
63+
[source,groovy]
64+
----
65+
package example
66+
67+
import grails.boot.annotation.GrailsComponentScan
68+
69+
@GrailsComponentScan(basePackages=['com.appone', 'com.apptwo'])
70+
class Application {
71+
72+
}
73+
----

0 commit comments

Comments
 (0)