import org.springframework.stereotype.Repository;
@Repository
public interface CustomRepository extends JpaRepository<Object, Long> {
@Query(value = "SELECT name FROM student", nativeQuery = true)
List<String> getAllStudentNames();
}
Will this work if not what will be the solution for this? I don't want to create student Entity.