DATACOUCH-161 - Improve multitemplate mapping configuration

The configuration step made it look like a new mapping was necessary in overrides, whereas it is actually possible and clearer to mutate the base mapping.

Added a convenience method to get the MappingContext from the repository mapping.
This commit is contained in:
Simon Baslé
2015-11-13 16:24:41 +01:00
parent 95ea97244a
commit 2f68740247
6 changed files with 41 additions and 11 deletions

View File

@@ -106,8 +106,8 @@ public class RepositoryTemplateWiringTests {
}
@Override
public RepositoryOperationsMapping repositoryOperationsMapping() throws Exception {
return new RepositoryOperationsMapping(templateC())
public void configureRepositoryOperationsMapping(RepositoryOperationsMapping base) {
base.setDefault(templateC())
.map(BucketBRepository.class, templateB())
.mapEntity(Item.class, templateA());
}