microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
94 stars 64 forks source link

ropertyReferenceException: No property saveAll found for type #410

Closed rishits85 closed 5 years ago

rishits85 commented 5 years ago

While using spring data cosmos db version 2.1.2 I am getting the following error

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property saveAll found for type MyType

Below is my class:

@Repository
public interface Myrepo extends DocumentDbRepository<MyType, String> {

    public MyType findBySomeType(String someType);

    public List<MyType> saveAll(List<MyType> myType);
}

This happens only for the saveAll method. If I do the save method it works fine. What am I missing?

rishits85 commented 5 years ago

Figured out the issue. I had overridden the method saveAll in my interface which is already implemented in the CRUDRespository interface extended by DocumentDBREpository

nsaftarli commented 4 years ago

Figured out the issue. I had overridden the method saveAll in my interface which is already implemented in the CRUDRespository interface extended by DocumentDBREpository

Did you get to the bottom of why this works? I'm having the same problem, except I'm subclassing CrudRepository directly. I've overridden other methods (e.g. save, findAll), but only saveAll is causing this problem for me. Your fix works, but I'm not sure why.