我定义了以下存储库
public interface CityVerboseRepository extends JpaRepository<CityVerbose, Integer>{
List<CityVerbose> findByStreetStartingWith(String street);
}
对应实体
@Entity
public class CityVerbose {
@Id
public Integer id;
public String street;
}
但我得到的只是
could not create query metamodel for method public abstract java.util.List
一旦我尝试 Autowiring 该存储库。我所有其他存储库都工作得很好......
最佳答案
startingWith
语法在 spring data 的 1.0.3.RELEASE 中不可用。更新到 1.2.0.RELEASE 并且一切正常
关于java - 无法在简单的 JPA 存储库上创建查询元模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14482593/