2017-10-28 136 views
0

升級後形成Spring Boot 1.5.7.Release到Spring Boot 1.5.8.Release我收到以下異常: org.springframework.data.mapping.PropertyReferenceException:找不到屬性searchByMongoQuery for Auto! 相同的課程在1.5.7中像魅力一樣工作。有沒有人知道1.5.7到1.5.8的變化?Spring Boot 1.5.8.Release - Spring Data Mongo PropertyReferenceException

這裏是我的課:

public interface AutoRepositoryCustom { 
    Page<Auto> searchByMongoQuery(String value, Pageable pageable); 
} 

public class AutoRepositoryImpl implements AutoRepositoryCustom { 

    private final MongoTemplate mongoTemplate; 

    @Autowired 
    public AutoRepositoryImpl (MongoTemplate mongoTemplate) { 
     Assert.notNull(mongoTemplate, "MongoTemplate must not be null!"); 
     this.mongoTemplate = mongoTemplate; 
    } 
    @Override 
    public Page<Auto> searchByMongoQuery(String rawMongoQuery, Pageable pageable) {......} 
} 


@RepositoryRestResource() 
public interface AutoRepository 
     extends MongoRepository<Auto, String>, AutoRepositoryCustom { 
} 

有沒有人有線索? 謝謝

回答

0

我終於設法通過將AutoRepositoryImpl移動到放置AutoRepository類的子包來解決此問題。

0

據對Github上this評論:

執行(默認地將Impl)類必須在相同的包中存儲庫接口。

相關問題