2
我想结合弹簧数据的MongoDB和ElasticSearch
@org.springframework.data.mongodb.core.mapping.Document(collection = "goal")
@org.springframework.data.elasticsearch.annotations.Document(indexName = "goal")
public class Goal implements Serializable {
....}
但是这给了我:
Error creating bean with name 'goalRepository':
Invocation of init method failed; nested exception is
org.springframework.data.mapping.PropertyReferenceException:
No property insert found for type Goal! ->
BTW:我添加的属性的名称。该错误就会消失“插入'到目标或我从目标中删除elasticsearch注释。
的GoalRepository是:
package org.jhipster.mongo.repository;
import org.jhipster.mongo.domain.Goal;
import org.springframework.data.mongodb.repository.MongoRepository;
public interface GoalRepository extends MongoRepository<Goal,String> {
}
你能附上'GoalRepository'代码呢? –