@CompileStatic @GroovyASTTransformation(phase: CompilePhase.CANONICALIZATION) class GormEntityTransformation extends AbstractASTTransformation implements CompilationUnitAware, ASTTransformation
An AST transformation that adds the following features:
- An id and version (if not already present)
- A toString() method (if not already present)
- Associations and association methods (addTo*, removeFrom*) etc.
- Association id getter methods ('userId' for 'user' association)
- Adds the GormEntity and GormValidateable traits
- Named query methods
| Modifiers | Name | Description |
|---|---|---|
static Parameter[] |
ADD_TO_PARAMETERS |
|
static AnnotationNode |
JPA_ENTITY_ANNOTATION_NODE |
|
protected static ClassNode |
JPA_ENTITY_CLASS_NODE |
|
static AnnotationNode |
JPA_ID_ANNOTATION_NODE |
|
static AnnotationNode |
JPA_TRANSIENT_ANNOTATION_NODE |
|
static AnnotationNode |
JPA_VERSION_ANNOTATION_NODE |
|
static ClassNode |
SERIALIZABLE_CLASS_NODE |
|
protected CompilationUnit |
compilationUnit |
| Fields inherited from class | Fields |
|---|---|
class AbstractASTTransformation |
RETENTION_CLASSNODE |
| Constructor and description |
|---|
GormEntityTransformation() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
ListExpression |
getOrCreateListProperty(ClassNode classNode, String name) |
|
protected void |
injectIdProperty(ClassNode classNode) |
|
protected void |
injectVersionProperty(ClassNode classNode) |
|
protected Class |
pickGormEntityTrait(ClassNode classNode, SourceUnit source) |
|
void |
setCompilationUnit(CompilationUnit compilationUnit) |
|
void |
visit(ASTNode[] astNodes, SourceUnit sourceUnit) |
|
void |
visit(ClassNode classNode, SourceUnit sourceUnit) |
| Methods inherited from class | Name |
|---|---|
class AbstractASTTransformation |
addError, checkPropertyList, checkPropertyList, checkPropertyList, deemedInternalName, equals, getAnnotationName, getClass, getMemberClassList, getMemberClassValue, getMemberClassValue, getMemberIntValue, getMemberStringList, getMemberStringValue, getMemberStringValue, getMemberValue, hasAnnotation, hashCode, memberHasValue, notify, notifyAll, shouldSkip, shouldSkip, shouldSkipOnDescriptorUndefinedAware, shouldSkipUndefinedAware, shouldSkipUndefinedAware, toString, tokenize, visit, wait, wait, wait |