I have a need for a repository that simply persists records to the databases, so i wrote a custom generic base repository that extends CrudRepository
but only implements the save method, as described here.
@NoRepositoryBean
public interface PersistingRepository<T, ID extends Serializable> extends CrudRepository<T, ID> {
T save(T item);
}
However, my compiler complains that "save(T) in 'PersistingRepository' clashes with 'save(S)' in 'org.springframework.data.repository.CrudRepository'; both method have the same erasure, yet neither overrides the other"
Researching the problem led me to these SO posts: this and this, which place the blame on dependency issues between spring-data-commons
and spring-data-jpa
. Updating my spring-boot-starter-parent
version to 1.5.7.RELEASE
results in those dependencies being updated to the most recent RELEASE available on MavenCentral (commons: 1.13.7, jpa: 1.11.7), but the erasure class persists.
So my question is how can this dependency conflict be resolved?