@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Department {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long departmentId;
private String departmentName;
private String departmentAddress;
private String departmentCode;
}
the above code is my entity class Department
@Repository
public interface DepartmentRepository extends JpaRepository<Department,Long> {
Department findDepartmentById(Long departmentId);
// Department getDepartmentById(Long deptId);
}
my repositoy interface DepartmentRepository
I am getting the below error. Few days back I did the same code , everything same , it worked but now it is throwing this error, Please help me in solving this error
com.wipro.DepartmentmicroService.repository.DepartmentRepository.findDepartmentById(java.lang.String)! No property 'id' found for type 'Department'