I implemented the MultiTenant support by:
- Extending
SimpleMongoRepository
to add the missing EntityInformation JavaType to extract the@MultiTenantField
value from the Entity. - Extending
MongoTemplate
to add the logic to add the@MultiTenantField
value to the query and save operations.
I implemented those methods that we needed in our product. As we are using more functionality, we detect the missing methods, and we add them to the library.
Method | Overriden | Description |
---|---|---|
void deleteAll() |
✔️ | It missed the entityInformation.getCollectionName() in order to filter by tenant |
Method | Overriden | Description |
---|---|---|
<T> T doFindOne(String collectionName, CollectionPreparer<MongoCollection<Document>> collectionPreparer, Document query, Document fields, CursorPreparer preparer, Class<T> entityClass) |
✔️ | - |