diff --git a/src/main/groovy/grails/plugin/scaffolding/GormService.groovy b/src/main/groovy/grails/plugin/scaffolding/GormService.groovy index 9a47c72..75c78d8 100644 --- a/src/main/groovy/grails/plugin/scaffolding/GormService.groovy +++ b/src/main/groovy/grails/plugin/scaffolding/GormService.groovy @@ -7,6 +7,7 @@ import grails.gorm.transactions.Transactional import grails.util.GrailsNameUtils import groovy.transform.CompileStatic import org.grails.datastore.gorm.GormEntity +import org.grails.datastore.gorm.GormEntityApi @Artefact("Service") @ReadOnly @@ -46,7 +47,7 @@ class GormService> { if (readOnly) { return } - resource.delete(queryForResource(id), [flush: true]) + ((GormEntityApi) queryForResource(id)).delete flush: true } @Transactional @@ -54,6 +55,6 @@ class GormService> { if (readOnly) { return instance } - resource.save(instance, [flush: true]) + (T) ((GormEntityApi) instance).save(flush: true) } } \ No newline at end of file