Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 10a30aa

Browse files
committed
Merge remote-tracking branch 'origin/7.3.x' into 8.0.x
2 parents 644c4f2 + 3a0fc2a commit 10a30aa

18 files changed

+210
-21
lines changed

.github/release-drafter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ version-resolver:
3131
labels:
3232
- 'type: patch'
3333
default: patch
34+
commitsh: $BASE_REF_NAME
35+
filter-by-commitsh: true
3436
template: |
3537
## What's Changed
3638

.github/workflows/release-notes.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ jobs:
1616
id: check_release_drafter
1717
run: |
1818
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
19-
echo ::set-output name=has_release_drafter::${has_release_drafter}
19+
echo "has_release_drafter=${has_release_drafter}" >> $GITHUB_OUTPUT
2020
- name: Extract branch name
2121
id: extract_branch
22-
run: echo ::set-output name=value::${GITHUB_REF:11}
22+
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
2323
# If it has release drafter:
2424
- uses: release-drafter/release-drafter@v5
2525
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
2828
with:
2929
commitish: ${{ steps.extract_branch.outputs.value }}
30-
filter-by-commitish: true
3130
# Otherwise:
3231
- name: Export Gradle Properties
3332
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ buildscript {
55
}
66
dependencies {
77
classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.2"
8-
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
8+
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
99
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
1010
classpath "io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1"
1111
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
1212
classpath "org.grails.plugins:views-gradle:2.3.2"
1313
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1'
1414
classpath "gradle.plugin.com.energizedwork.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion"
15-
classpath "org.gradle:test-retry-gradle-plugin:1.4.1"
15+
classpath "org.gradle:test-retry-gradle-plugin:1.5.2"
1616
}
1717
}
1818

@@ -121,11 +121,11 @@ subprojects { Project subproject ->
121121
}
122122

123123
dependencies {
124-
testImplementation "io.projectreactor:reactor-test:3.5.0"
124+
testImplementation "io.projectreactor:reactor-test:3.5.5"
125125
testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion"
126126
testImplementation("org.spockframework:spock-core:$spockVersion") { transitive = false}
127127
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
128-
testImplementation "org.junit.platform:junit-platform-runner:1.9.1"
128+
testImplementation "org.junit.platform:junit-platform-runner:1.9.3"
129129
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
130130
}
131131

@@ -226,7 +226,7 @@ subprojects { Project subproject ->
226226
testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion"
227227
testImplementation("org.spockframework:spock-core:$spockVersion") { transitive = false}
228228
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
229-
testImplementation "org.junit.platform:junit-platform-runner:1.9.1"
229+
testImplementation "org.junit.platform:junit-platform-runner:1.9.3"
230230
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
231231
}
232232

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ gormVersion=8.0.0-M1
66
grailsGradlePluginVersion=6.0.0-SNAPSHOT
77
groovyVersion=3.0.11
88
h2Version=1.4.200
9-
hibernate5Version=5.6.11.Final
9+
hibernate5Version=5.6.15.Final
1010
hibernateValidatorVersion=6.2.5.Final
1111
hibernateGroovyProxy=1.1
1212
jansiVersion=2.4.0
@@ -16,18 +16,18 @@ junitJupiterVersion=5.9.1
1616
micronautVersion=3.8.8
1717
micronautSpringVersion=4.5.1
1818
picocliVersion=4.6.3
19-
projectVersion=7.3.1-SNAPSHOT
19+
projectVersion=8.0.0-SNAPSHOT
2020
pluginGrailsVersion=6.0.0-M2
2121
seleniumSafariDriverVersion=3.14.0
2222
seleniumVersion=3.14.0
2323
servletApiVersion=4.0.1
2424
slf4jVersion=1.7.36
25-
snakeyamlVersion=1.32
25+
snakeyamlVersion=1.33
2626
spockVersion=2.1-groovy-3.0
27-
springBootVersion=2.7.3
27+
springBootVersion=2.7.11
2828
springVersion=5.3.20
2929
tomcatLog4jVersion=8.5.2
30-
tomcatVersion=9.0.69
30+
tomcatVersion=9.0.74
3131
webdriverBinariesVersion=1.4
3232

3333
# Following are used only for example projects
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

grails-datastore-gorm-hibernate5/src/main/groovy/grails/orm/hibernate/HibernateEntity.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package grails.gorm.hibernate
22

33
import groovy.transform.CompileStatic
4+
import groovy.transform.Generated
45
import org.grails.datastore.gorm.GormEnhancer
56
import org.grails.datastore.gorm.GormEntity
67
import org.grails.orm.hibernate.AbstractHibernateGormStaticApi
@@ -21,6 +22,7 @@ trait HibernateEntity<D> extends GormEntity<D> {
2122
*
2223
* @return The object
2324
*/
25+
@Generated
2426
static List<D> findAllWithSql(CharSequence sql) {
2527
currentHibernateStaticApi().findAllWithSql sql, Collections.emptyMap()
2628
}
@@ -31,6 +33,7 @@ trait HibernateEntity<D> extends GormEntity<D> {
3133
* @param sql The sql query
3234
* @return The entity
3335
*/
36+
@Generated
3437
static D findWithSql(CharSequence sql) {
3538
currentHibernateStaticApi().findWithSql(sql, Collections.emptyMap())
3639
}
@@ -42,6 +45,7 @@ trait HibernateEntity<D> extends GormEntity<D> {
4245
*
4346
* @return The object
4447
*/
48+
@Generated
4549
static List<D> findAllWithSql(CharSequence sql, Map args) {
4650
currentHibernateStaticApi().findAllWithSql sql, args
4751
}
@@ -52,10 +56,12 @@ trait HibernateEntity<D> extends GormEntity<D> {
5256
* @param sql The sql query
5357
* @return The entity
5458
*/
59+
@Generated
5560
static D findWithSql(CharSequence sql, Map args) {
5661
currentHibernateStaticApi().findWithSql(sql, args)
5762
}
5863

64+
@Generated
5965
private static AbstractHibernateGormStaticApi currentHibernateStaticApi() {
6066
(AbstractHibernateGormStaticApi)GormEnhancer.findStaticApi(this)
6167
}

grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/AbstractHibernateDatastore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public MultiTenancySettings.MultiTenancyMode getMultiTenancyMode() {
163163

164164
@Override
165165
public Datastore getDatastoreForTenantId(Serializable tenantId) {
166-
if(multiTenantMode == MultiTenancySettings.MultiTenancyMode.DATABASE) {
166+
if(getMultiTenancyMode() == MultiTenancySettings.MultiTenancyMode.DATABASE) {
167167
return getDatastoreForConnection(tenantId.toString());
168168
}
169169
else {

grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/AbstractHibernateGormInstanceApi.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ abstract class AbstractHibernateGormInstanceApi<D> extends GormInstanceApi<D> {
390390
setObjectToReadOnly target
391391
if (entity) {
392392
for (Association association in entity.associations) {
393-
if (association instanceof ToOne) {
393+
if (association instanceof ToOne && !association instanceof Embedded) {
394394
if(proxyHandler.isInitialized(target, association.name)) {
395395
def bean = new BeanWrapperImpl(target)
396396
def propertyValue = bean.getPropertyValue(association.name)

grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,9 @@ else if(tablePerConcreteClass) {
15161516
if (m.getDynamicInsert()) {
15171517
subClass.setDynamicInsert(true);
15181518
}
1519-
1519+
1520+
subClass.setCached(parent.isCached());
1521+
15201522
subClass.setAbstract(sub.isAbstract());
15211523
subClass.setEntityName(fullName);
15221524
subClass.setJpaEntityName(unqualify(fullName));
@@ -3036,6 +3038,9 @@ protected void createKeyForProps(PersistentProperty grailsProp, String path, Tab
30363038
for (Iterator<?> i = propertyNames.iterator(); i.hasNext();) {
30373039
String propertyName = (String) i.next();
30383040
PersistentProperty otherProp = grailsProp.getOwner().getPropertyByName(propertyName);
3041+
if (otherProp == null) {
3042+
throw new MappingException(grailsProp.getOwner().getJavaClass().getName() + " references an unknown property " + propertyName);
3043+
}
30393044
String otherColumnName = getColumnNameForPropertyAndPath(otherProp, path, null, sessionFactoryBeanName);
30403045
keyList.add(new Column(otherColumnName));
30413046
}

grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/compiler/HibernateEntityTransformation.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.grails.orm.hibernate.compiler
33
import grails.gorm.dirty.checking.DirtyCheckedProperty
44
import groovy.transform.CompilationUnitAware
55
import groovy.transform.CompileStatic
6+
import org.apache.groovy.ast.tools.AnnotatedNodeUtils
67
import org.codehaus.groovy.ast.*
78
import org.codehaus.groovy.ast.stmt.BlockStatement
89
import org.codehaus.groovy.ast.stmt.IfStatement
@@ -124,6 +125,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
124125
returnS(varX(interceptorField))
125126
)
126127
classNode.addMethod(getInterceptorMethod)
128+
AnnotatedNodeUtils.markAsGenerated(classNode, getInterceptorMethod)
127129
staticCompilationVisitor.visitMethod(getInterceptorMethod)
128130

129131
// add method: void $$_hibernate_setInterceptor(PersistentAttributeInterceptor interceptor)
@@ -137,6 +139,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
137139
assignS( varX(interceptorField), varX(p1) )
138140
)
139141
classNode.addMethod(setInterceptorMethod)
142+
AnnotatedNodeUtils.markAsGenerated(classNode, setInterceptorMethod)
140143
staticCompilationVisitor.visitMethod(setInterceptorMethod)
141144

142145
// add method: Object $$_hibernate_getEntityInstance()
@@ -149,6 +152,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
149152
returnS(varX("this"))
150153
)
151154
classNode.addMethod(getEntityInstanceMethod)
155+
AnnotatedNodeUtils.markAsGenerated(classNode, getEntityInstanceMethod)
152156
staticCompilationVisitor.visitMethod(getEntityInstanceMethod)
153157

154158

@@ -162,6 +166,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
162166
returnS(varX(entityEntryHolderField))
163167
)
164168
classNode.addMethod(getEntityEntryMethod)
169+
AnnotatedNodeUtils.markAsGenerated(classNode, getEntityEntryMethod)
165170
staticCompilationVisitor.visitMethod(getEntityEntryMethod)
166171

167172
// add method: void $$_hibernate_setEntityEntry(EntityEntry entityEntry)
@@ -175,6 +180,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
175180
assignS( varX(entityEntryHolderField), varX(entityEntryParam) )
176181
)
177182
classNode.addMethod(setEntityEntryMethod)
183+
AnnotatedNodeUtils.markAsGenerated(classNode, setEntityEntryMethod)
178184
staticCompilationVisitor.visitMethod(setEntityEntryMethod)
179185

180186
// add method: ManagedEntity $$_hibernate_getPreviousManagedEntity()
@@ -187,6 +193,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
187193
returnS(varX(previousManagedEntityField))
188194
)
189195
classNode.addMethod(getPreviousManagedEntityMethod)
196+
AnnotatedNodeUtils.markAsGenerated(classNode, getPreviousManagedEntityMethod)
190197
staticCompilationVisitor.visitMethod(getPreviousManagedEntityMethod)
191198

192199
// add method: ManagedEntity $$_hibernate_getNextManagedEntity() {
@@ -199,6 +206,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
199206
returnS(varX(nextManagedEntityField))
200207
)
201208
classNode.addMethod(getNextManagedEntityMethod)
209+
AnnotatedNodeUtils.markAsGenerated(classNode, getNextManagedEntityMethod)
202210
staticCompilationVisitor.visitMethod(getNextManagedEntityMethod)
203211

204212
// add method: void $$_hibernate_setPreviousManagedEntity(ManagedEntity previous)
@@ -212,6 +220,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
212220
assignS( varX(previousManagedEntityField), varX(previousParam) )
213221
)
214222
classNode.addMethod(setPreviousManagedEntityMethod)
223+
AnnotatedNodeUtils.markAsGenerated(classNode, setPreviousManagedEntityMethod)
215224
staticCompilationVisitor.visitMethod(setPreviousManagedEntityMethod)
216225

217226
// add method: void $$_hibernate_setNextManagedEntity(ManagedEntity next)
@@ -225,6 +234,7 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni
225234
assignS( varX(nextManagedEntityField), varX(nextParam) )
226235
)
227236
classNode.addMethod(setNextManagedEntityMethod)
237+
AnnotatedNodeUtils.markAsGenerated(classNode, setNextManagedEntityMethod)
228238
staticCompilationVisitor.visitMethod(setNextManagedEntityMethod)
229239

230240
List<MethodNode> allMethods = classNode.getMethods()

0 commit comments

Comments
 (0)