当前位置: 首页>>代码示例>>Java>>正文


Java SolrCrudRepository类代码示例

本文整理汇总了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);
}
 
开发者ID:rmap-project,项目名称:rmap,代码行数:25,代码来源:AbstractEventTupleIndexerTest.java

示例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);
}
 
开发者ID:rmap-project,项目名称:rmap,代码行数:20,代码来源:DiscosIndexer.java

示例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));
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:11,代码来源:SolrRepositoryConfigExtensionUnitTests.java

示例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);
}
 
开发者ID:rmap-project,项目名称:rmap,代码行数:7,代码来源:DiscosIndexerTest.java

示例5: getIdentifyingTypes

import org.springframework.data.solr.repository.SolrCrudRepository; //导入依赖的package包/类
@Override
protected Collection<Class<?>> getIdentifyingTypes() {
	return Arrays.<Class<?>> asList(SolrRepository.class, SolrCrudRepository.class);
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:5,代码来源:SolrRepositoryConfigExtension.java

示例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");
}
 
开发者ID:rmap-project,项目名称:rmap,代码行数:20,代码来源:AbstractEventTupleIndexer.java


注:本文中的org.springframework.data.solr.repository.SolrCrudRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。