0
votes

In grails 4 (grails 3+), we have to mark the domain classes with multi tenant trait and also its respective services and controllers. For eg :

class Book implements MultiTenant<Book> {
    String title
}

@CurrentTenant
class BookService {

    @WithoutTenant
    int countBooks() {
        Book.count()
    }
}

Is there a configuration for gorm to make everything as multi tenant? My requirement is, based on domain name for eg: abc.com or xyz.com where tenants are abc and xyz i need to switch database but i don't want to go on to annotate each domain class and controllers.

1

1 Answers

0
votes

Is there a configuration for gorm to make everything as multi tenant?

No.

You have options like you could build an AST transformation that would do such a thing, but no feature like that exists in the framework itself.