我想了解spring data solr showcase项目。spring data solr showcase
https://github.com/christophstrobl/spring-data-solr-showcase
花费相当多的时间之后,我找不到productRepository如何实施和在https://github.com/christophstrobl/spring-data-solr-showcase/blob/master/src/main/java/org/springframework/data/solr/showcase/product/ProductServiceImpl.java
@Service class ProductServiceImpl implements ProductService {
private static final Pattern IGNORED_CHARS_PATTERN = Pattern.compile("\\p{Punct}");
private ProductRepository productRepository;
@Autowired
public void setProductRepository(ProductRepository productRepository) {
this.productRepository = productRepository;
}
的ProductRepository注入被定义为接口(https://github.com/christophstrobl/spring-data-solr-showcase/blob/master/src/main/java/org/springframework/data/solr/showcase/product/ProductRepository.java)我没有发现任何代码实现这个接口
interface ProductRepository extends SolrCrudRepository<Product, String> {
@Highlight(prefix = "<b>", postfix = "</b>")
@Query(fields = { SearchableProductDefinition.ID_FIELD_NAME,
SearchableProductDefinition.NAME_FIELD_NAME,
SearchableProductDefinition.PRICE_FIELD_NAME,
SearchableProductDefinition.FEATURES_FIELD_NAME,
SearchableProductDefinition.AVAILABLE_FIELD_NAME },
defaultOperator = Operator.AND)
HighlightPage<Product> findByNameIn(Collection<String> names, Pageable page);
@Facet(fields = { SearchableProductDefinition.NAME_FIELD_NAME })
FacetPage<Product> findByNameStartsWith(Collection<String> nameFragments, Pageable pagebale);
}
下面是Spring上下文是如何配置: https://github.com/christophstrobl/spring-data-solr-showcase/blob/master/src/main/java/org/springframework/data/solr/showcase/Application.java
如果任何人都可以点我到这个接口被实现并注入的方向,那将是巨大的。
从马的嘴......感谢您的回应。 – Srik 2014-12-05 16:19:09