diff --git a/build.gradle b/build.gradle index 9293319c793..8c0598b2b40 100644 --- a/build.gradle +++ b/build.gradle @@ -117,6 +117,7 @@ subprojects { dependencies { + implementation platform("org.grails:grails-bom:$grailsVersion") api "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion" implementation "jakarta.validation:jakarta.validation-api:$jakartaValidationVersion" compileOnly "com.github.spotbugs:spotbugs-annotations:$jsr305Version" diff --git a/gradle.properties b/gradle.properties index c574380a5f3..3b0ad1ff61f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ gradleNexusPluginVersion=2.3.1 gradleNexusPublishPluginVersion=1.3.0 grailsAsyncVersion=6.0.0-SNAPSHOT grailsVersion=7.0.0-SNAPSHOT -groovyVersion=4.0.23 +groovyVersion=4.0.24-SNAPSHOT h2Version=2.3.232 hibernateValidatorVersion=7.0.5.Final jansiVersion=2.4.1 diff --git a/grails-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/GormMappingInheritanceTests.groovy b/grails-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/GormMappingInheritanceTests.groovy index 608efe43b4a..0f9d1ad3779 100644 --- a/grails-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/GormMappingInheritanceTests.groovy +++ b/grails-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/GormMappingInheritanceTests.groovy @@ -12,7 +12,6 @@ import static org.junit.jupiter.api.Assertions.* /** * Tests for correct mapping of entities with inheritance. */ -@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity and org.grails.datastore.gorm.GormEntity") class GormMappingInheritanceTests { @Test @@ -105,14 +104,14 @@ class GormMappingInheritanceTests { } } -//@Entity +@Entity class DerivedEntity extends SecondEntity { String baz static transients = ['baz'] } -//@Entity +@Entity class SpecialUser extends User { Set specialFriends @@ -130,7 +129,7 @@ class Parent { static hasMany = [children: BaseChild] } -//@Entity +@Entity class BaseChild { Long id @@ -144,7 +143,7 @@ class DerivedChild extends BaseChild { String prop } -//@Entity +@Entity class EmbeddedTest { Long id @@ -159,7 +158,7 @@ class DerivedEmbeddedTest extends EmbeddedTest { static embedded = ['testEntity2'] } -//@Entity +@Entity class MappingTest { Long id @@ -170,7 +169,7 @@ class MappingTest { } } -//@Entity +@Entity class MappingTest2 extends MappingTest { String toIndex2 @@ -182,14 +181,14 @@ class MappingTest2 extends MappingTest { } } -//@Entity +@Entity class DerivedEntityChildA extends DerivedEntity { } -//@Entity +@Entity class DerivedEntityChildB extends DerivedEntity { } -//@Entity +@Entity class DerivedEntityChildC extends DerivedEntity { } \ No newline at end of file diff --git a/grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/InheritanceSpec.groovy b/grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/InheritanceSpec.groovy index 134bf83514c..912608e71d9 100644 --- a/grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/InheritanceSpec.groovy +++ b/grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/InheritanceSpec.groovy @@ -7,7 +7,6 @@ import grails.persistence.Entity /** * @author graemerocher */ -@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity and org.grails.datastore.gorm.GormEntity") class InheritanceSpec extends GormDatastoreSpec { @Override @@ -100,7 +99,7 @@ class Practice implements Serializable { static hasMany = [locations: Location] } -//@Entity +@Entity class Location implements Serializable { // Long id Long version diff --git a/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/BidirectionalOneToManyWithInheritanceSpec.groovy b/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/BidirectionalOneToManyWithInheritanceSpec.groovy index c54f64f3da7..1369578b073 100644 --- a/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/BidirectionalOneToManyWithInheritanceSpec.groovy +++ b/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/BidirectionalOneToManyWithInheritanceSpec.groovy @@ -8,7 +8,6 @@ import grails.persistence.Entity /** * @author graemerocher */ -@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity and org.grails.datastore.gorm.GormEntity") class BidirectionalOneToManyWithInheritanceSpec extends GormDatastoreSpec { void "Test a bidirectional one-to-many association with inheritance"() { @@ -34,7 +33,7 @@ class BidirectionalOneToManyWithInheritanceSpec extends GormDatastoreSpec { } } -//@Entity +@Entity class ConfigurationItem { Long id Long version diff --git a/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/InheritanceWithOneToManySpec.groovy b/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/InheritanceWithOneToManySpec.groovy index d72f2fc5350..734adf75add 100644 --- a/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/InheritanceWithOneToManySpec.groovy +++ b/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/InheritanceWithOneToManySpec.groovy @@ -7,7 +7,6 @@ import grails.persistence.Entity import spock.lang.Issue -@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity and org.grails.datastore.gorm.GormEntity") class InheritanceWithOneToManySpec extends GormDatastoreSpec{ @Issue('GRAILS-9010') @@ -38,7 +37,7 @@ class Group { Collection members } -//@Entity +@Entity class Member { Long id String name diff --git a/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/validation/UniqueConstraintSpec.groovy b/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/validation/UniqueConstraintSpec.groovy index b0d97b7a617..47b44e627cf 100644 --- a/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/validation/UniqueConstraintSpec.groovy +++ b/grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/validation/UniqueConstraintSpec.groovy @@ -14,7 +14,6 @@ import spock.lang.AutoCleanup import spock.lang.Specification @Transactional -@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity and org.grails.datastore.gorm.GormEntity") class UniqueConstraintSpec extends Specification { @AutoCleanup SimpleMapDatastore datastore = new SimpleMapDatastore( @@ -145,7 +144,7 @@ class UniqueConstraintSpec extends Specification { } -//@Entity +@Entity class Channel { String name @@ -177,7 +176,7 @@ class ListChannel extends Channel { } -//@Entity +@Entity class OtherListChannel extends ListChannel { static constraints = { diff --git a/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy b/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy index f670e6304eb..9cd03c6b2be 100644 --- a/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy +++ b/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy @@ -8,53 +8,53 @@ package org.grails.datastore.gorm * * @param The entity type */ -interface GormEntityApi { +trait GormEntityApi { /** * Proxy aware instanceOf implementation. */ - boolean instanceOf(Class cls) + abstract boolean instanceOf(Class cls) /** * Upgrades an existing persistence instance to a write lock * @return The instance */ - D lock() + abstract D lock() /** * Locks the instance for updates for the scope of the passed closure * * @param callable The closure * @return The result of the closure */ - def mutex(Closure callable) + abstract def mutex(Closure callable) /** * Refreshes the state of the current instance * @return The instance */ - D refresh() + abstract D refresh() /** * Saves an object the datastore * @return Returns the instance */ - D save() + abstract D save() /** * Forces an insert of an object to the datastore * @return Returns the instance */ - D insert() + abstract D insert() /** * Forces an insert of an object to the datastore * @return Returns the instance */ - D insert(Map params) + abstract D insert(Map params) /** * Saves an object the datastore * @return Returns the instance */ - D merge() + abstract D merge() /** * Saves an object the datastore * @return Returns the instance */ - D merge(Map params) + abstract D merge(Map params) /** * Save method that takes a boolean which indicates whether to perform validation or not * @@ -62,39 +62,39 @@ interface GormEntityApi { * * @return The instance or null if validation fails */ - D save(boolean validate) + abstract D save(boolean validate) /** * Saves an object with the given parameters * @param instance The instance * @param params The parameters * @return The instance */ - D save(Map params) + abstract D save(Map params) /** * Returns the objects identifier */ - Serializable ident() + abstract Serializable ident() /** * Attaches an instance to an existing session. Requries a session-based model * @return */ - D attach() + abstract D attach() /** * No concept of session-based model so defaults to true */ - boolean isAttached() + abstract boolean isAttached() /** * Discards any pending changes. Requires a session-based model. */ - void discard() + abstract void discard() /** * Deletes an instance from the datastore */ - void delete() + abstract void delete() /** * Deletes an instance from the datastore */ - void delete(Map params) + abstract void delete(Map params) /** * Checks whether a field is dirty * @@ -103,12 +103,12 @@ interface GormEntityApi { * * @return true if the field is dirty */ - boolean isDirty(String fieldName) + abstract boolean isDirty(String fieldName) /** * Checks whether an entity is dirty * * @param instance The instance * @return true if it is dirty */ - boolean isDirty() + abstract boolean isDirty() } \ No newline at end of file diff --git a/grails-datastore-gorm/src/test/groovy/org/grails/compiler/gorm/EntityWithGenericSignaturesSpec.groovy b/grails-datastore-gorm/src/test/groovy/org/grails/compiler/gorm/EntityWithGenericSignaturesSpec.groovy index da0fbc727b4..505c74c2a0d 100644 --- a/grails-datastore-gorm/src/test/groovy/org/grails/compiler/gorm/EntityWithGenericSignaturesSpec.groovy +++ b/grails-datastore-gorm/src/test/groovy/org/grails/compiler/gorm/EntityWithGenericSignaturesSpec.groovy @@ -11,7 +11,6 @@ import spock.lang.Specification /** * Created by graemerocher on 16/09/2016. */ -@Ignore("https://issues.apache.org/jira/browse/GROOVY-5106 - The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity and org.grails.datastore.gorm.GormEntity") class EntityWithGenericSignaturesSpec extends Specification { void "Test compile entity with generic signatures"() { @@ -35,7 +34,7 @@ abstract class WidgetSetting { String name } -//@Entity +@Entity class HotWidgetSetting extends WidgetSetting { Integer temperature }