本文整理汇总了Java中org.springframework.data.solr.core.SolrTemplate.afterPropertiesSet方法的典型用法代码示例。如果您正苦于以下问题:Java SolrTemplate.afterPropertiesSet方法的具体用法?Java SolrTemplate.afterPropertiesSet怎么用?Java SolrTemplate.afterPropertiesSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.data.solr.core.SolrTemplate
的用法示例。
在下文中一共展示了SolrTemplate.afterPropertiesSet方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTargetRepository
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
protected Object getTargetRepository(RepositoryMetadata metadata) {
SolrOperations operations = this.solrOperations;
if (factory != null) {
SolrTemplate template = new SolrTemplate(factory);
template.setSolrCore(SolrServerUtils.resolveSolrCoreName(metadata.getDomainType()));
addSchemaCreationFeaturesIfEnabled(template);
template.afterPropertiesSet();
operations = template;
}
SimpleSolrRepository repository = new SimpleSolrRepository(getEntityInformation(metadata.getDomainType()),
operations);
repository.setEntityClass(metadata.getDomainType());
this.templateHolder.add(metadata.getDomainType(), operations);
return repository;
}
示例2: createTemplate
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
private SolrTemplate createTemplate(SolrServer solrServer) {
SolrTemplate template = new SolrTemplate(solrServer);
addSchemaCreationFeaturesIfEnabled(template);
template.afterPropertiesSet();
return template;
}
示例3: setUp
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
@Before
public void setUp() {
repository = new ExampleSolrBeanRepository();
SolrTemplate template = new SolrTemplate(solrServer, null);
template.afterPropertiesSet();
repository.setSolrOperations(template);
}
示例4: testGetRepositoryOfUnmanageableType
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testGetRepositoryOfUnmanageableType() {
SolrTemplate template = new SolrTemplate(new HttpSolrServer("http://solrserver:8983/solr"), null);
template.afterPropertiesSet();
new SolrRepositoryFactory(template).getRepository(UnmanagedEntityRepository.class);
}
示例5: createSolrTemplate
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
@Produces
public SolrOperations createSolrTemplate() throws IOException, ParserConfigurationException, SAXException {
EmbeddedSolrServerFactory factory = new EmbeddedSolrServerFactory(ResourceUtils.getURL(
"classpath:org/springframework/data/solr").getPath());
SolrTemplate template = new SolrTemplate(factory);
template.afterPropertiesSet();
return template;
}
示例6: testSetUp
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
@Before
public void testSetUp() throws Exception {
super.testSetUp();
ObjectMapper objectMapper = objectMapperProducer.objectMapper(false, false);
client = new HttpSolrClient("http://localhost:8983/solr");
classSetUp();
template = new SolrTemplate(client);
template.setSchemaCreationFeatures(Collections.singletonList(SolrPersistentEntitySchemaCreator.Feature.CREATE_MISSING_FIELDS));
MySolrJConverter converter = new MySolrJConverter();
template.setSolrConverter(converter);
template.afterPropertiesSet();
}
示例7: setUp
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
@Before
public void setUp() {
SolrTemplate template = new SolrTemplate(new HttpSolrServerFactory(solrServer));
template.afterPropertiesSet();
factory = new SolrRepositoryFactory(template);
}
示例8: setUp
import org.springframework.data.solr.core.SolrTemplate; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException, ParserConfigurationException, SAXException {
solrTemplate = new SolrTemplate(solrServer, null);
solrTemplate.afterPropertiesSet();
}