Skip to content

Commit 2f84812

Browse files
committed
Refine GormEntityTransformation: Adding 'Artefact' annotation to Gorm Entity
Closes gh-62
1 parent 2c54881 commit 2f84812

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

grace-datastore-gorm/src/main/groovy/org/grails/compiler/gorm/GormEntityTransformation.groovy

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015 original authors
2+
* Copyright 2015-2025 original authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -92,6 +92,7 @@ import static org.codehaus.groovy.ast.tools.GeneralUtils.returnS
9292
* - Named query methods<br>
9393
*
9494
* @author Graeme Rocher
95+
* @author Michael Yan
9596
* @since 5.0
9697
*/
9798
@CompileStatic
@@ -187,6 +188,13 @@ class GormEntityTransformation extends AbstractASTTransformation implements Comp
187188
// Only GORM classes on the classpath continue
188189
}
189190
}
191+
try {
192+
AstUtils.addAnnotationOrGetExisting(classNode,
193+
(Class<? extends Annotation>) getClass().classLoader.loadClass('grails.artefact.Artefact'),
194+
[value: 'Domain'] as Map<String, Object>)
195+
}
196+
catch (Throwable ignored) {
197+
}
190198
}
191199

192200
// Add the Jackson @JsonIgnoreProperties if Jackson is present

0 commit comments

Comments
 (0)