@AstTransformer public class DefaultGrailsDomainClassInjector extends java.lang.Object implements GrailsArtefactClassInjector, GrailsDomainClassInjector
Default implementation of domain class injector interface that adds the 'id' and 'version' properties and other previously boilerplate code.
Where a GORM implementation is on the classpath its own transformation runs first and has
already added these properties, which makes every injection here a no-op - each is guarded on the
property not already being present. That order matters: only GORM's transformation knows which
implementation an entity is mapped with, so only it can honour a build that has asked for native
identity types. This injector always adds a Long id, and is what an entity gets where GORM
is absent or did not process it.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public java.lang.String[] |
getArtefactTypes() |
|
public void |
performInjection(SourceUnit source, GeneratorContext context, ClassNode classNode) |
|
public void |
performInjection(SourceUnit source, ClassNode classNode) |
|
public void |
performInjectionOnAnnotatedClass(SourceUnit source, ClassNode classNode) |
|
public void |
performInjectionOnAnnotatedEntity(ClassNode classNode) |
|
public boolean |
shouldInject(java.net.URL url) |
|
protected boolean |
shouldInjectClass(ClassNode classNode) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |