When assign select JPA It gives an error as bellow. What is the issue?
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.finance.resources.StudentForBankStatement(s.admission_no,s.first' at line 1`
Query
@Query( value = "select NEW com.finance.resources.StudentForBankStatement(s.admission_no,s.first_name,s.last_name) from student s where branch_id = ?1", nativeQuery = true ) List<StudentForBankStatement> getStudentByClassIdBranchId( long branchId ); Helper Class
@Data @AllArgsConstructor @NoArgsConstructor public class StudentForBankStatement { private String AdmissionNo; private String firstName; private String lastName; }