|
1 | 1 | ==== Dependency Upgrades |
2 | 2 |
|
3 | | -GORM 7.0 supports a minimum version of Java 8, Hibernate 5.3.x and Spring 5.2.x. |
| 3 | +GORM 7.1 supports Apache Groovy 3 and Java 14 Hibernate 5.5.x and Spring 5.3.x. |
4 | 4 |
|
5 | 5 | Each of these underlying components may have changes that require altering your application. These changes are beyond the scope of this documentation. |
6 | 6 |
|
| 7 | +==== Default Autowire By Type inside GORM Data Services |
7 | 8 |
|
8 | | -==== Package Restructuring and Deprecations |
| 9 | +A Grails Service (or a bean) inside GORM DataService will default to autowire by-type, For example: |
9 | 10 |
|
10 | | -Previously deprecated classes have been deleted from this release and in order to support Java 11 modules in the future some package re-structuring has occurred. |
| 11 | +_./grails-app/services/example/BookService.groovy_ |
| 12 | +``` |
| 13 | +package example |
11 | 14 |
|
12 | | -==== Changes to Proxy Handling |
| 15 | +import grails.gorm.services.Service |
13 | 16 |
|
14 | | -GORM no longer creates custom proxy factories nor automatically unwraps Hibernate proxies. |
| 17 | +@Service(Book) |
| 18 | +abstract class BookService { |
15 | 19 |
|
16 | | -This makes it more consistent to the way regular Hibernate behaves and reduces the complexity required at the framework level. |
| 20 | + TestService testRepo |
17 | 21 |
|
18 | | -You may need to alter `instanceof` checks are manually unwrap proxies in certain cases. |
| 22 | + abstract Book save(String title, String author) |
19 | 23 |
|
20 | | -==== Module `grails-validation` Deprecated and Removed |
| 24 | + void doSomething() { |
| 25 | + assert testRepo != null |
| 26 | + } |
| 27 | +} |
| 28 | +``` |
21 | 29 |
|
22 | | -In GORM 6.x the `grails-validation` module was deprecated and replaced by `grails-datastore-gorm-validation`. |
| 30 | +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/docs/5.3.10/reference/html/core.html#beans-autowired-annotation-qualifiers[Fine-tuning Annotation Based Autowiring with Qualifiers]. |
23 | 31 |
|
24 | | -Deprecated interfaces were maintained for backwards compatibility. In GORM 7.0 these deprecated classes have been removed and all dependency on `grails-validation` removed. |
25 | | - |
26 | | -==== Transactions Now Required for all Operations |
27 | | - |
28 | | -Previous versions of Hibernate allowed read operations to be executed without the presence of a declaration transaction. |
29 | | - |
30 | | -Hibernate 5.2 and above require the presence of an active transaction. If see a `javax.persistence.TransactionRequiredException` exception it means your method lacks a `@Transactional` annotation around it. |
|
0 commit comments