use of org.springframework.data.mongodb.core.convert.DbRefResolverCallback in project spring-data-mongodb by spring-projects.
the class ReactivePerformanceTests method setUp.
@BeforeEach
public void setUp() throws Exception {
mongo = MongoClients.create();
SimpleReactiveMongoDatabaseFactory mongoDbFactory = new SimpleReactiveMongoDatabaseFactory(this.mongo, DATABASE_NAME);
MongoMappingContext context = new MongoMappingContext();
context.setInitialEntitySet(Collections.singleton(Person.class));
context.afterPropertiesSet();
converter = new MappingMongoConverter(new DbRefResolver() {
@Nullable
@Override
public Object resolveReference(MongoPersistentProperty property, Object source, ReferenceLookupDelegate referenceLookupDelegate, MongoEntityReader entityReader) {
return null;
}
@Override
public Object resolveDbRef(MongoPersistentProperty property, DBRef dbref, DbRefResolverCallback callback, DbRefProxyHandler proxyHandler) {
return null;
}
@Override
public DBRef createDbRef(org.springframework.data.mongodb.core.mapping.DBRef annotation, MongoPersistentEntity<?> entity, Object id) {
return null;
}
@Override
public Document fetch(DBRef dbRef) {
return null;
}
@Override
public List<Document> bulkFetch(List<DBRef> dbRefs) {
return null;
}
}, context);
operations = new ReactiveMongoTemplate(mongoDbFactory, converter);
ReactiveMongoRepositoryFactory factory = new ReactiveMongoRepositoryFactory(operations);
repository = factory.getRepository(ReactivePersonRepository.class);
}
Aggregations