@Target({ ElementType.METHOD, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented @GroovyASTTransformationClass("org.grails.datastore.gorm.transform.OrderedGormTransformation") @GormASTTransformationClass("org.grails.datastore.gorm.multitenancy.transform.TenantTransform") public @interface CurrentTenant
An AST transformation that makes a particular class or method applicable to the tenant id returned by the passed closure. For example:
class FooService {
@CurrentTenant
void updateFoo() {
...
}
}
If you are using multiple GORM implementations and wish to create a transaction for a specific implementation then use this.
For example @Transactional(forDatastore=HibernateDatastore)