Is it possible to move spring data repo Implementation to different folder (not same or sub folder of original inteface)? If I have interface and implementation in same folder all works fine. If I move it from e.g com.app.domain.repo
to com.app.infrastr.repo
, I get Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property methodName found for type RepoInterfaceName
.
UPDATE
import com.app.domain.repo
public interface ARepo extends ElasticsearchRepository<A, String>, CustomizedARepo {
}
public interface CustomizedARepo {
List<A> makeSearch(int x);
}
import com.app.infrastr.repo
public class CustomizedARepoImpl implements CustomizedARepo {
private ElasticsearchTemplate elasticsearchTemplate;
public CustomizedARepoImpl(ElasticsearchTemplate elasticsearchTemplate) {
this.elasticsearchTemplate = elasticsearchTemplate;
}
@Override
public List<A> makeSearch(int x){ return null; }
}
And configuration class is
@Configuration
@EnableElasticsearchRepositories(basePackages = {"com.app.domain.repo", "com.app.infrastr.repo"})
public class Config{}
Error is:
Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property makeSearch found for type ARepo
If I move CustomizedARepoImpl
to com.app.domain.repo
all works OK.