【发布时间】:2016-04-02 17:20:47
【问题描述】:
我在努力
@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! ->
顺便说一句:只要我将名为“insert”的属性添加到目标或从目标中删除 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代码吗?
标签: java spring mongodb spring-data-mongodb spring-data-elasticsearch