-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic collection NamingStrategy #2935
Comments
You can define your own |
We have implemented the In our case, we have multiple collections for the same object, one for each tenant. Which collection the object is written to depends on which tenant is currently saving the object. For example, we have The Before we used to override the |
Multitenancy isn't directly supported in 2.x though it's on the roadmap for 3.x. If you need something like that now, your best bet is to create a |
I've made the change locally to support this use case. I've added a new method to the
As Not sure if this works as a broader solution, but thought it might be worth sharing. Of course, it could be optimised, maybe with an option specifying if the |
Is your feature request related to a problem? Please describe.
We use different collections based on the tenant. Previously (v1.x) it was possible to override the getCollectionName method in the Mapper. We would like to be able to use a dynamic NamingStrategy based on the current tenant. However, the current NamingStrategy sets the collectionName in the EntityModel on load and it cannot be changed after that.
Describe the solution you'd like
The NamingStrategy should be called when the getCollectionName() method is called on the EntityModel. Or at least, there should be an option to make it dynamic, so that it's called on getCollectionName().
Describe alternatives you've considered
Can't see any alternative options at the moment.
The text was updated successfully, but these errors were encountered: