0

Why happen such error? I am using Spring Data JPA 1.3.3 , Spring 4.2.8 and Spring MVC 4.2.8.

UPDATE: Error as code block

Error:Error:line (8)java: name clash: save(java.lang.Iterable) in org.springframework.data.jpa.repository.JpaRepository and save(java.lang.Iterable) in org.springframework.data.repository.CrudRepository have the same erasure, yet neither overrides the other

All my libraries added as IntelliJ Idea's Module. Only JSTL is downloaded by Maven.

enter image description here

kopylov
  • 1,281
  • 3
  • 9
  • 12

3 Answers3

0

It seems you have dependency problem. An older version of Spring Data Common with Spring Data JPA might be the problem.

John Lash
  • 114
  • 1
  • 4
0

For spring data jpa, It's not really good idea to write native query in repo. Unless your demands are just to hard to write query methods.

For your case, you just need simple query methods like this

List<User> findByFirstName(String firstName);

Return list of User because many Users might have the same userName

Take a look at spring data doc Query methods

Hope it help :)

Chhea Vanrin
  • 135
  • 3
  • 10
  • Ohh ok!! But your problem was because of spring being confuse native & methods query. you may want to clarify which one to use by rename your method or add `nativeQuery = true` to your native query param – Chhea Vanrin Jan 04 '17 at 02:51
0

For those who face the Ignite Spring Data and Spring JPA dependency issue - you need to downgrade org.springframework.data:spring-data-jpa version to 1.11.23.RELEASE. Thanks to @chirdeep-tomar comment!

In my project compatibility issues of IgniteRepository and CrudRepository with deleteAll() method were solved with the following Maven configuration:

    'org.springframework:spring-core:5.2.3.RELEASE'
    'org.springframework.data:spring-data-jpa:1.11.23.RELEASE'
    'org.apache.ignite:ignite-spring-data:2.9.0'
    'org.apache.ignite:ignite-core:2.9.0'
    'org.apache.ignite:ignite-spring:2.9.0'
roseaysina
  • 135
  • 1
  • 9