Under Grails 2.4.4, we had classes we used as wrappers for domain objects.
They would look like this:
class Foo {
@Delegate
OurDomainClass ourDomainClass
...
}
This worked, but when trying to compile under Grails 3.0.11, we get this:
> Foo.groovy: 14: Can't have an abstract method in a non-abstract class.
> The class 'Foo' must be declared abstract or the method
> 'org.springframework.validation.Errors
> org_grails_datastore_gorm_GormValidateable__errors$get()' must be
> implemented. @ line 14, column 1. class Foo { ^
Removing the @Delegate
annotation will make compilation pass, but calls to methods of the underlying class obviously then do not work.
Is there a way to work around this or to achieve this same behavior and have it pass compilation under Grails 3?
Does good old static hasMany = []
or static hasOne = []
won't do the job? Of course wrappers would be domain classes then too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With