Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class GormMappingInheritanceTests {

@Test
Expand Down Expand Up @@ -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

Expand All @@ -130,7 +129,7 @@ class Parent {
static hasMany = [children: BaseChild]
}

//@Entity
@Entity
class BaseChild {
Long id

Expand All @@ -144,7 +143,7 @@ class DerivedChild extends BaseChild {
String prop
}

//@Entity
@Entity
class EmbeddedTest {
Long id

Expand All @@ -159,7 +158,7 @@ class DerivedEmbeddedTest extends EmbeddedTest {
static embedded = ['testEntity2']
}

//@Entity
@Entity
class MappingTest {
Long id

Expand All @@ -170,7 +169,7 @@ class MappingTest {
}
}

//@Entity
@Entity
class MappingTest2 extends MappingTest {

String toIndex2
Expand All @@ -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 {
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class InheritanceSpec extends GormDatastoreSpec {

@Override
Expand Down Expand Up @@ -100,7 +99,7 @@ class Practice implements Serializable {
static hasMany = [locations: Location]
}

//@Entity
@Entity
class Location implements Serializable {
// Long id
Long version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class BidirectionalOneToManyWithInheritanceSpec extends GormDatastoreSpec {

void "Test a bidirectional one-to-many association with inheritance"() {
Expand All @@ -34,7 +33,7 @@ class BidirectionalOneToManyWithInheritanceSpec extends GormDatastoreSpec {
}
}

//@Entity
@Entity
class ConfigurationItem {
Long id
Long version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class InheritanceWithOneToManySpec extends GormDatastoreSpec{

@Issue('GRAILS-9010')
Expand Down Expand Up @@ -38,7 +37,7 @@ class Group {
Collection members
}

//@Entity
@Entity
class Member {
Long id
String name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class UniqueConstraintSpec extends Specification {

@AutoCleanup SimpleMapDatastore datastore = new SimpleMapDatastore(
Expand Down Expand Up @@ -145,7 +144,7 @@ class UniqueConstraintSpec extends Specification {
}


//@Entity
@Entity
class Channel {

String name
Expand Down Expand Up @@ -177,7 +176,7 @@ class ListChannel extends Channel {
}


//@Entity
@Entity
class OtherListChannel extends ListChannel {

static constraints = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,93 +8,93 @@ package org.grails.datastore.gorm
*
* @param <D> The entity type
*/
interface GormEntityApi<D> {
trait GormEntityApi<D> {
/**
* 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
*
* @param validate Whether to perform validation
*
* @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
*
Expand All @@ -103,12 +103,12 @@ interface GormEntityApi<D> {
*
* @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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>")
class EntityWithGenericSignaturesSpec extends Specification {

void "Test compile entity with generic signatures"() {
Expand All @@ -35,7 +34,7 @@ abstract class WidgetSetting {
String name
}

//@Entity
@Entity
class HotWidgetSetting extends WidgetSetting {
Integer temperature
}
Expand Down
Loading