本文整理汇总了Java中org.springframework.data.solr.repository.SolrCrudRepository类的典型用法代码示例。如果您正苦于以下问题:Java SolrCrudRepository类的具体用法?Java SolrCrudRepository怎么用?Java SolrCrudRepository使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SolrCrudRepository类属于org.springframework.data.solr.repository包,在下文中一共展示了SolrCrudRepository类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDefaultDocumentDecorator
import org.springframework.data.solr.repository.SolrCrudRepository; //导入依赖的package包/类
/**
* Insure that a non-null document decorator is provided by the abstract impl\
*/
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
public void testDefaultDocumentDecorator() {
Function documentMapper = mock(Function.class);
SolrCrudRepository repository = mock(SolrCrudRepository.class);
SolrTemplate template = mock(SolrTemplate.class);
AbstractEventTupleIndexer underTest = new AbstractEventTupleIndexer(documentMapper, repository, template) {
@Override
public void preIndex(EventDiscoTuple tuple) {
}
@Override
public void postIndex(Object solrDocument) {
}
};
assertNotNull(underTest.documentDecorator);
}
示例2: DiscosIndexer
import org.springframework.data.solr.repository.SolrCrudRepository; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @param documentMapper {@inheritDoc}
* @param repository {@inheritDoc}
* @param template {@inheritDoc}
*/
public DiscosIndexer(Function<EventDiscoTuple, DiscoSolrDocument> documentMapper,
SolrCrudRepository<DiscoSolrDocument, Long> repository, SolrTemplate template) {
super(documentMapper, repository, template);
// There *is* a Spring Bean definition for DiscoSolrOperations that *ought* to be injected by this constructor.
// However, DiscoSolrOperations test coverage is nill. Testing of DiscoSolrOperations is indirectly
// accomplished by the DiscosIndexerTest, whereby expectations on the SolrTemplate are verified.
// If DiscoSolrOperations is injected into this constructor, then the DiscoIndexerTest would need to be
// re-written with expectations against DiscoSolrOperations, not the SolrTemplate. And DiscoSolrOperations
// would need its own test. All good things, but due to lack of time, leaving this as a TODO.
this.discoOperations = new DiscosSolrOperations(template, CORE_NAME);
}
示例3: shoudReturnStoreSpecificRepositoryInterfacesAsIdentifyingTypes
import org.springframework.data.solr.repository.SolrCrudRepository; //导入依赖的package包/类
/**
* @see DATASOLR-184
*/
@Test
public void shoudReturnStoreSpecificRepositoryInterfacesAsIdentifyingTypes() {
assertThat(extension.getIdentifyingTypes(), hasSize(2));
assertThat(extension.getIdentifyingTypes(),
IsCollectionContaining.<Class<?>> hasItems(SolrRepository.class, SolrCrudRepository.class));
}
示例4: setUpMocks
import org.springframework.data.solr.repository.SolrCrudRepository; //导入依赖的package包/类
@Before
@SuppressWarnings("unchecked")
public void setUpMocks() throws Exception {
this.mockTemplate = mock(SolrTemplate.class);
underTest = new DiscosIndexer(mock(EventDiscoTupleMapper.class), mock(SolrCrudRepository.class), mockTemplate);
}
示例5: getIdentifyingTypes
import org.springframework.data.solr.repository.SolrCrudRepository; //导入依赖的package包/类
@Override
protected Collection<Class<?>> getIdentifyingTypes() {
return Arrays.<Class<?>> asList(SolrRepository.class, SolrCrudRepository.class);
}
示例6: AbstractEventTupleIndexer
import org.springframework.data.solr.repository.SolrCrudRepository; //导入依赖的package包/类
/**
* Constructs a repository implementation that:
* <ul>
* <li>Produces Solr documents from {@link EventDiscoTuple}s using the supplied {@code documentMapper}</li>
* <li>Deposits Solr documents in the supplied {@link SolrCrudRepository}</li>
* <li>Provides the supplied {@link SolrTemplate} to implementations, allowing custom processing of the
* index</li>
* </ul>
* @param documentMapper maps tuples to Solr documents
* @param repository stores Solr documents
* @param template perform custom operations on indexes
*/
public AbstractEventTupleIndexer(Function<EventDiscoTuple, T> documentMapper, SolrCrudRepository<T, ID> repository,
SolrTemplate template) {
this.documentMapper = assertNotNull(documentMapper,
"EventDiscoTuple document mapper must not be null.");
this.repository = assertNotNull(repository, "Solr repository must not be null.");
this.template = assertNotNull(template, "Solr template must not be null");
}