I am trying to use JpaRepository but I am getting this error "jparepository cannot be resolved to a type."
My maven dependency is
` 4.0.0 org.springframework.boot spring-boot-starter-parent 2.3.2.RELEASE com.example accessing-data-jpa 0.0.1-SNAPSHOT accessing-data-jpa Demo project for Spring Boot
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
`
My student class is
package Repositry;
public interface Student_Repo extends JpaRepositry {
}
Please let me know what I have done wrong
Typo here.
It is JpaRepository not JpaRepositry
Also it expects 2 parameters.
Entity class
Type of primary key field (Integer/Long)
Like below.
Student_Repo extends JpaRepository<Student,Long>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With