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?
@Validatable
to your wrappers? – Repute